* libmisc/getlong.c: Make sure the getlong argument is not empty.
This commit is contained in:
parent
f47d9eba94
commit
186ea0e203
@ -1,3 +1,7 @@
|
||||
2009-03-07 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/getlong.c: Make sure the getlong argument is not empty.
|
||||
|
||||
2009-03-07 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* contrib/adduser-old.c, contrib/adduser.c: Do not use the target
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 - 2008, Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -41,7 +41,7 @@ int getlong(const char *numstr, long int *result)
|
||||
|
||||
errno = 0;
|
||||
val = strtol (numstr, &endptr, 10);
|
||||
if (('\0' != *endptr) || (ERANGE == errno)) {
|
||||
if (('\0' == numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user