diff options
| author | Ulrich Weber <ulrich.weber@sophos.com> | 2011-12-21 02:24:11 +0400 | 
|---|---|---|
| committer | Denis Ovsienko <infrastation@yandex.ru> | 2012-01-02 19:50:57 +0400 | 
| commit | 830526a51292e6241f7b6415e070f3780fe18e1e (patch) | |
| tree | 42cf042cfc95db7be191be0fe538386b78e45c05 /lib | |
| parent | 65cd7a4a66145cf666df707781c3e46297158c58 (diff) | |
lib: fix some strtoul() use cases
...otherwise 4294967295 is not a valid value on 32bit systems
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/vty.h | 3 | 
1 files changed, 2 insertions, 1 deletions
| @@ -152,8 +152,9 @@ struct vty  #define VTY_GET_LONG(NAME,V,STR) \  do { \    char *endptr = NULL; \ +  errno = 0; \    (V) = strtoul ((STR), &endptr, 10); \ -  if (*endptr != '\0' || (V) == ULONG_MAX) \ +  if (*(STR) == '-' || *endptr != '\0' || errno) \      { \        vty_out (vty, "%% Invalid %s value%s", NAME, VTY_NEWLINE); \        return CMD_WARNING; \ | 
