]> Zhao Yanbai Git Server - minix.git/commitdiff
libsys: let optset parse largeish positive values
authorDavid van Moolenbroek <david@minix3.org>
Mon, 3 Sep 2012 11:51:56 +0000 (11:51 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Mon, 3 Sep 2012 12:20:17 +0000 (12:20 +0000)
Note that strtoul() also parses negative numbers correctly.

lib/libsys/optset.c

index fe9bedaea6d2f66736d31caa9e0c52849829c18f..f3ef2a0067649885ca994d6ccec70147a64dc144 100644 (file)
@@ -55,7 +55,7 @@ int len;
 
   case OPT_INT:
        if (len > 0)
-               val = strtol(ptr, NULL, entry->os_val);
+               val = (int) strtoul(ptr, NULL, entry->os_val);
        else
                val = 0;