diff --git a/mx_util.c b/mx_util.c index 48718e56..bc472ab0 100644 --- a/mx_util.c +++ b/mx_util.c @@ -256,7 +256,7 @@ int mx_strtoul(char *str, unsigned long int *to) ul = strtoul(str, &end, 0); - if (errno) + if (errno > 0) return -errno; end = mx_strskipwhitespaces(end); @@ -284,7 +284,7 @@ int mx_strtoull(char *str, unsigned long long int *to) ull = strtoull(str, &end, 0); - if (errno) + if (errno > 0) return -errno; end = mx_strskipwhitespaces(end); @@ -314,7 +314,7 @@ int mx_strtol(char *str, signed long int *to) l = strtoul(str, &end, 0); - if (errno) + if (errno > 0) return -errno; end = mx_strskipwhitespaces(end); @@ -339,7 +339,7 @@ int mx_strtoll(char *str, signed long long int *to) ll = strtoll(str, &end, 0); - if (errno) + if (errno > 0) return -errno; end = mx_strskipwhitespaces(end);