]> granicus.if.org Git - shadow/commitdiff
* libmisc/getlong.c: Avoid implicit conversion of pointers / chars to booleans.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 25 May 2008 23:25:33 +0000 (23:25 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 25 May 2008 23:25:33 +0000 (23:25 +0000)
* libmisc/getlong.c: Add brackets.

ChangeLog
libmisc/getlong.c

index cad11f962f381e7d4b322be4e13755ae87eafd30..6bce5ff24acd95fe8e9b2794c0be766097f8d7fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
 2008-05-26  Nicolas François  <nicolas.francois@centraliens.net>
 
-       * libmisc/valid.c: Avoid implicit conversion of pointers /chars to
-       booleans.
+       * libmisc/getlong.c: Avoid implicit conversion of pointers / chars
+       to booleans.
+       * libmisc/getlong.c: Add brackets.
+
+2008-05-26  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/valid.c: Avoid implicit conversion of pointers / chars
+       to booleans.
        * libmisc/valid.c: Add brackets.
 
 2008-05-26  Nicolas François  <nicolas.francois@centraliens.net>
index 3dd5614d6ebd18f2e4d8fd9b6c85882aecc89ab5..7ea3a80db891cc6792ad00fa3addc3d6a0d5bd73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007       , Nicolas François
+ * Copyright (c) 2007 - 2008, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,8 +40,9 @@ int getlong(const char *numstr, long int *result)
        char *endptr;
 
        val = strtol (numstr, &endptr, 10);
-       if (*endptr || errno == ERANGE)
+       if (('\0' != *endptr) || (ERANGE == errno)) {
                return 0;
+       }
 
        *result = val;
        return 1;