lib/limits.c: Fix wrong error check
strtol(3) doesn't specify a return value if (value == endptr). It is always an error, if (value==endptr). Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Iker Pedrosa
parent
00e4e0c735
commit
9b798b584a
+2
-1
@@ -62,7 +62,8 @@ static int setrlimit_value (unsigned int resource,
|
||||
*/
|
||||
char *endptr;
|
||||
long longlimit = strtol (value, &endptr, 10);
|
||||
if ((0 == longlimit) && (value == endptr)) {
|
||||
|
||||
if (value == endptr) {
|
||||
/* No argument at all. No-op.
|
||||
* FIXME: We could instead throw an error, though.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user