From: Lennart Poettering Date: Tue, 6 Jul 2010 18:15:08 +0000 (+0200) Subject: util: fix space calculation in get_process_cmdline() X-Git-Tag: v1~20 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=057fbb58851f97cfcf4d90d5d3c539ac6f8ab13d;p=systemd util: fix space calculation in get_process_cmdline() --- diff --git a/src/util.c b/src/util.c index 8c22dbef..d1120c60 100644 --- a/src/util.c +++ b/src/util.c @@ -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; }