Commit 37a5dcd4 by Stéphane Graber Committed by GitHub

Merge pull request #1573 from brauner/2017-05-18/fix_ppc64le_build

utils: fix ppc64le builds
parents 78678dc1 ff0e49c7
......@@ -2009,7 +2009,7 @@ int lxc_safe_uint(const char *numstr, unsigned int *converted)
errno = 0;
uli = strtoul(numstr, &err, 0);
if (errno == ERANGE && uli == ULONG_MAX)
return -errno;
return -ERANGE;
if (err == numstr || *err != '\0')
return -EINVAL;
......@@ -2029,10 +2029,10 @@ int lxc_safe_int(const char *numstr, int *converted)
errno = 0;
sli = strtol(numstr, &err, 0);
if (errno == ERANGE && (sli == LONG_MAX || sli == LONG_MIN))
return -errno;
return -ERANGE;
if (errno != 0 && sli == 0)
return -errno;
return -EINVAL;
if (err == numstr || *err != '\0')
return -EINVAL;
......@@ -2052,10 +2052,10 @@ int lxc_safe_long(const char *numstr, long int *converted)
errno = 0;
sli = strtol(numstr, &err, 0);
if (errno == ERANGE && (sli == LONG_MAX || sli == LONG_MIN))
return -errno;
return -ERANGE;
if (errno != 0 && sli == 0)
return -errno;
return -EINVAL;
if (err == numstr || *err != '\0')
return -EINVAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment