diff options
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index d754c836f2..4f0b652f4f 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1077,6 +1077,7 @@ int get_process_exe(pid_t pid, char **name) { static int get_process_id(pid_t pid, const char *field, uid_t *uid) { _cleanup_fclose_ FILE *f = NULL; _cleanup_free_ char *p = NULL; + char line[LINE_MAX]; assert(field); assert(uid); @@ -1091,7 +1092,7 @@ static int get_process_id(pid_t pid, const char *field, uid_t *uid) { if (!f) return -errno; - FOREACH_LINE(f, line, return -errno) { + FOREACH_LINE(line, f, return -errno) { char *l; l = strstrip(line); |