diff options
-rw-r--r-- | procps/ps.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/procps/ps.c b/procps/ps.c index c6bffc60d..bbd546761 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -340,8 +340,9 @@ int ps_main(int argc, char **argv); | |||
340 | int ps_main(int argc, char **argv) | 340 | int ps_main(int argc, char **argv) |
341 | { | 341 | { |
342 | procps_status_t *p = NULL; | 342 | procps_status_t *p = NULL; |
343 | int i, len; | 343 | int len; |
344 | SKIP_SELINUX(const) int use_selinux = 0; | 344 | SKIP_SELINUX(const) int use_selinux = 0; |
345 | USE_SELINUX(int i;) | ||
345 | #if !ENABLE_FEATURE_PS_WIDE | 346 | #if !ENABLE_FEATURE_PS_WIDE |
346 | enum { terminal_width = 79 }; | 347 | enum { terminal_width = 79 }; |
347 | #else | 348 | #else |
@@ -367,7 +368,7 @@ int ps_main(int argc, char **argv) | |||
367 | i = getopt32(argc, argv, "Z"); | 368 | i = getopt32(argc, argv, "Z"); |
368 | #endif | 369 | #endif |
369 | #if ENABLE_SELINUX | 370 | #if ENABLE_SELINUX |
370 | if ((i & 1) && is_selinux_enabled()) | 371 | if (i && is_selinux_enabled()) |
371 | use_selinux = PSSCAN_CONTEXT; | 372 | use_selinux = PSSCAN_CONTEXT; |
372 | #endif | 373 | #endif |
373 | #endif /* ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX */ | 374 | #endif /* ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX */ |
@@ -404,7 +405,7 @@ int ps_main(int argc, char **argv) | |||
404 | } | 405 | } |
405 | 406 | ||
406 | { | 407 | { |
407 | char sz = terminal_width - len; | 408 | int sz = terminal_width - len; |
408 | char buf[sz + 1]; | 409 | char buf[sz + 1]; |
409 | read_cmdline(buf, sz, p->pid, p->comm); | 410 | read_cmdline(buf, sz, p->pid, p->comm); |
410 | puts(buf); | 411 | puts(buf); |