Wrong check

This commit is contained in:
Nicolás A. Ortega 2017-07-13 02:00:55 +02:00
parent c383e1b7bd
commit 655350bf25
No known key found for this signature in database
GPG Key ID: 3D786FB3123FF1DD

View File

@ -26,7 +26,7 @@
#include <assert.h> #include <assert.h>
int NeoComm_init_nodes(unsigned int max_nodes) { int NeoComm_init_nodes(unsigned int max_nodes) {
if(max_nodes == 0) if(max_nodes != 0)
return 1; return 1;
node_list = calloc(max_nodes, sizeof(struct NeoComm_node)); node_list = calloc(max_nodes, sizeof(struct NeoComm_node));
if(!node_list) if(!node_list)
@ -50,6 +50,7 @@ void NeoComm_shutdown_nodes() {
} }
int NeoComm_resize_node_list(unsigned int new_max_nodes) { int NeoComm_resize_node_list(unsigned int new_max_nodes) {
assert(node_list);
if(new_max_nodes <= node_max) if(new_max_nodes <= node_max)
return 0; return 0;