... well, your use of strncpy() does also make node[CF_MAXVARSIZE-1] = '\0' necessary; but it's better to not use strncpy !