diff --git a/src/nodes.c b/src/nodes.c index 505bd33..7671eba 100644 --- a/src/nodes.c +++ b/src/nodes.c @@ -26,7 +26,7 @@ #include int NeoComm_init_nodes(unsigned int max_nodes) { - if(max_nodes == 0) + if(max_nodes != 0) return 1; node_list = calloc(max_nodes, sizeof(struct NeoComm_node)); if(!node_list) @@ -50,6 +50,7 @@ void NeoComm_shutdown_nodes() { } int NeoComm_resize_node_list(unsigned int new_max_nodes) { + assert(node_list); if(new_max_nodes <= node_max) return 0;