Blob Blame History Raw
diff -up ./src/pstree.c.ori ./src/pstree.c
--- ./src/pstree.c.ori	2017-06-12 02:24:29.089210495 +0200
+++ ./src/pstree.c	2020-07-03 21:24:47.257760342 +0200
@@ -530,8 +530,12 @@ static void set_args(PROC * this, const
     }
     this->argc = 0;
     for (i = 0; i < size - 1; i++)
-        if (!args[i])
+        if (!args[i]) {
             this->argc++;
+            /* now skip consecutive NUL */
+            while(!args[i] && (i < size -1 ))
+                i++;
+        }
     if (!this->argc)
         return;
     if (!(this->argv = malloc(sizeof(char *) * this->argc))) {