]> granicus.if.org Git - shadow/commitdiff
* libmisc/getlong.c: Make sure the getlong argument is not empty.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 8 Mar 2009 20:21:24 +0000 (20:21 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 8 Mar 2009 20:21:24 +0000 (20:21 +0000)
ChangeLog
libmisc/getlong.c

index 566937ca7e8b214b73814fc6d123bdc72a12a6c3..efa98c80cb7eaa61f7c644122872d7788540ead2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 7c3d2ce0634f303e7d1d602ef78cd015416ea088..48914b37b99665278c694c9db7f7089800c3e107 100644 (file)
@@ -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
 #include "prototypes.h"
 #include "defines.h"
 
-int getlong(const char *numstr, long int *result)
+int getlong (const char *numstr, long int *result)
 {
        long val;
        char *endptr;
 
        errno = 0;
        val = strtol (numstr, &endptr, 10);
-       if (('\0' != *endptr) || (ERANGE == errno)) {
+       if (('\0' == numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
                return 0;
        }