]> err.no Git - systemd/commitdiff
util: fix space calculation in get_process_cmdline()
authorLennart Poettering <lennart@poettering.net>
Tue, 6 Jul 2010 18:15:08 +0000 (20:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 6 Jul 2010 18:33:54 +0000 (20:33 +0200)
src/util.c

index 8c22dbefa985b074bd8a945e1d81f65bf3d8b31f..d1120c60a5f3e7ee0bdd4636ddf98922ee56a193 100644 (file)
@@ -601,6 +601,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, char **line) {
                                         break;
 
                                 *(k++) = ' ';
+                                left--;
                                 space = false;
                         }
 
@@ -608,6 +609,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, char **line) {
                                 break;
 
                         *(k++) = (char) c;
+                        left--;
                 }  else
                         space = true;
         }