~jb55/polyadvent

7ad510b6278446bbbac587b0799fcf1fcc3590b8 — William Casarin 1 year, 7 months ago 4963791
I think this fixes something

can't remember why I did this

Signed-off-by: William Casarin <jb55@jb55.com>
1 files changed, 1 insertions(+), 1 deletions(-)

M src/node.c
M src/node.c => src/node.c +1 -1
@@ 69,7 69,7 @@ struct node *node_init(struct node *node) {

int node_set_label(struct node *node, const char *label)
{
    strncpy(node->label, label, sizeof(node->label));
    strncpy(node->label, label, sizeof(node->label)-1);
    // return 0 if the string is too big and that we've truncated it
    int ok = node->label[sizeof(node->label)-1] == '\0';
    // strncpy won't write this for large strings =/