Index: NumericInt.c
===================================================================
--- NumericInt.c	(revision 14602)
+++ NumericInt.c	(working copy)
@@ -215,12 +215,14 @@
       if((base == 0) || (base == 16)) {
         nptr += 2;  /* Skip the "0X"      */
         base = 16;  /* In case base was 0 */
+        pEnd = nptr;
       }
     }
     else {    /* Looks like Octal */
       if((base == 0) || (base == 8)) {
         ++nptr;     /* Skip the leading "0" */
         base = 8;   /* In case base was 0   */
+        pEnd = nptr;
       }
     }
   }
@@ -276,6 +278,7 @@
   unsigned long   Result = 0;
   unsigned long   Previous;
   int             temp;
+  BOOLEAN         Negative = FALSE;
 
   pEnd = nptr;
 
@@ -292,18 +295,25 @@
   if(*nptr == '+') {
     ++nptr;
   }
+  // we still must support the - sign
+  else if(*nptr == '-') {
+    Negative = TRUE;
+    ++nptr;
+  }
 
   if(*nptr == '0') {  /* Might be Octal or Hex */
     if(toupper(nptr[1]) == 'X') {   /* Looks like Hex */
       if((base == 0) || (base == 16)) {
         nptr += 2;  /* Skip the "0X"      */
         base = 16;  /* In case base was 0 */
+        pEnd = nptr;
       }
     }
     else {    /* Looks like Octal */
       if((base == 0) || (base == 8)) {
         ++nptr;     /* Skip the leading "0" */
         base = 8;   /* In case base was 0   */
+        pEnd = nptr;
       }
     }
   }
@@ -321,10 +331,14 @@
     if( Result < Previous)  {   // If we overflowed
       Result = ULONG_MAX;
       errno = ERANGE;
+      Negative = FALSE;
       break;
     }
     pEnd = ++nptr;
   }
+  if(Negative) {
+    Result = 0-Result;
+  }
 
   // Save pointer to final sequence
   if(endptr != NULL) {
@@ -379,12 +393,14 @@
       if((base == 0) || (base == 16)) {
         nptr += 2;  /* Skip the "0X"      */
         base = 16;  /* In case base was 0 */
+        pEnd = nptr;
       }
     }
     else {    /* Looks like Octal */
       if((base == 0) || (base == 8)) {
         ++nptr;     /* Skip the leading "0" */
         base = 8;   /* In case base was 0   */
+        pEnd = nptr;
       }
     }
   }
@@ -440,6 +456,7 @@
   unsigned long long    Result = 0;
   unsigned long long    Previous;
   int                   temp;
+  BOOLEAN               Negative = FALSE;
 
   pEnd = nptr;
 
@@ -456,18 +473,25 @@
   if(*nptr == '+') {
     ++nptr;
   }
+  // we still must support the - sign
+  else if(*nptr == '-') {
+    Negative = TRUE;
+    ++nptr;
+  }
 
   if(*nptr == '0') {  /* Might be Octal or Hex */
     if(toupper(nptr[1]) == 'X') {   /* Looks like Hex */
       if((base == 0) || (base == 16)) {
         nptr += 2;  /* Skip the "0X"      */
         base = 16;  /* In case base was 0 */
+        pEnd = nptr;
       }
     }
     else {    /* Looks like Octal */
       if((base == 0) || (base == 8)) {
         ++nptr;     /* Skip the leading "0" */
         base = 8;   /* In case base was 0   */
+        pEnd = nptr;
       }
     }
   }
@@ -485,10 +509,14 @@
     if( Result < Previous)  {   // If we overflowed
       Result = ULLONG_MAX;
       errno = ERANGE;
+      Negative = FALSE;
       break;
     }
     pEnd = ++nptr;
   }
+  if(Negative) {
+    Result = 0-Result;
+  }
 
   // Save pointer to final sequence
   if(endptr != NULL) {
