]> granicus.if.org Git - procps-ng/commitdiff
library: adapt for increased (cmd) program name length
authorJim Warner <james.warner@comcast.net>
Fri, 1 Jun 2018 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sat, 9 Jun 2018 11:35:20 +0000 (21:35 +1000)
In the new library 'cmd' is dynamically allocated just
like 'cmdline'. This will align us with the ref below.

Reference(s):
. master branch increase to 64
commit 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/readproc.c

index bd87bb4435f2f0a08484d339fa6fcaca1e18ac8e..4a8d6bb18dddf9ec72873e32b83dfcc0c6bc71a8 100644 (file)
@@ -268,7 +268,7 @@ ENTER(0x220);
 #endif
 
     case_Name:
-    {   char buf[16];
+    {   char buf[64];
         unsigned u = 0;
         while(u < sizeof(buf) - 1u){
             int c = *S++;
@@ -283,7 +283,7 @@ ENTER(0x220);
             buf[u++] = c;
         }
         buf[u] = '\0';
-        if (!P->cmd && !(P->cmd = strndup(buf, 15)))
+        if (!P->cmd && !(P->cmd = strdup(buf)))
             return 1;
         S--;   // put back the '\n' or '\0'
         continue;