A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use right test for error checking.
[simgrid.git]
/
src
/
xbt
/
config.c
diff --git
a/src/xbt/config.c
b/src/xbt/config.c
index
41abae5
..
2b352b1
100644
(file)
--- 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);
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);
}
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);
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);
}
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);
*(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);
}
xbt_die("Value of option %s not valid. Should be an peer (machine:port)", key);
}