]> granicus.if.org Git - procps-ng/commitdiff
2.5.xx allows 32-bit PID
authoralbert <>
Mon, 30 Sep 2002 22:31:21 +0000 (22:31 +0000)
committeralbert <>
Mon, 30 Sep 2002 22:31:21 +0000 (22:31 +0000)
ps/parser.c

index f3f671bd3a35f2ae186e4e0582b20d4df3c265c0..1e92be24c48eef2f9c972033cac21b56e6199d66 100644 (file)
@@ -75,13 +75,13 @@ static const char *get_opt_arg(void){
 
 static const char *parse_pid(char *str, sel_union *ret){
   char *endp;
-  int num;
+  unsigned long num;
   static const char *pidrange  = "Process ID out of range.";
   static const char *pidsyntax = "Process ID list syntax error.";
-  num = strtol(str, &endp, 0);
-  if(*endp != '\0')   return pidsyntax;
-  if(num>0x7fff)      return pidrange;  /* Linux PID limit */
-  if(num<1)           return pidrange;
+  num = strtoul(str, &endp, 0);
+  if(*endp != '\0')      return pidsyntax;
+  if(num<1)              return pidrange;
+  if(num > 0x7fffffffUL) return pidrange;
   ret->pid = num;
   return 0;
 }