polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 7ad510b6278446bbbac587b0799fcf1fcc3590b8
parent 4963791592f8b1f6ea91a6121bc5fc8f54cca279
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 19 Apr 2020 17:21:46 -0700

I think this fixes something

can't remember why I did this

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/node.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/node.c b/src/node.c @@ -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 =/