From: Arnaud Giersch Date: Tue, 7 May 2013 08:46:01 +0000 (+0200) Subject: Use right test for error checking. X-Git-Tag: v3_9_90~394 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fabcad3489b65a4fbe2fdcce5c08a6b1be076471 Use right test for error checking. --- diff --git a/src/xbt/config.c b/src/xbt/config.c index 41abae5762..2b352b1569 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -684,7 +684,7 @@ void *xbt_cfg_set_as_string(xbt_cfg_t cfg, const char *key, const char *value) { case xbt_cfgelm_int: i = strtol(value, &ret, 0); - if (value == NULL) { + if (ret == value) { xbt_die("Value of option %s not valid. Should be an integer", key); } @@ -693,7 +693,7 @@ void *xbt_cfg_set_as_string(xbt_cfg_t cfg, const char *key, const char *value) { case xbt_cfgelm_double: d = strtod(value, &ret); - if (value == NULL) { + if (ret == value) { xbt_die("Value of option %s not valid. Should be a double", key); } @@ -710,7 +710,7 @@ void *xbt_cfg_set_as_string(xbt_cfg_t cfg, const char *key, const char *value) { *(val++) = '\0'; i = strtol(val, &ret, 0); - if (val == NULL) { + if (ret == val) { xbt_die("Value of option %s not valid. Should be an peer (machine:port)", key); }