diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/ps.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/procps/ps.c b/procps/ps.c index 9fca3524e..07ff7568f 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -670,8 +670,8 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
670 | OPT_l = (1 << ENABLE_SELINUX) * (1 << ENABLE_FEATURE_SHOW_THREADS) * ENABLE_FEATURE_PS_LONG, | 670 | OPT_l = (1 << ENABLE_SELINUX) * (1 << ENABLE_FEATURE_SHOW_THREADS) * ENABLE_FEATURE_PS_LONG, |
671 | }; | 671 | }; |
672 | #if ENABLE_FEATURE_PS_LONG | 672 | #if ENABLE_FEATURE_PS_LONG |
673 | time_t now = now; | 673 | time_t now = now; /* for compiler */ |
674 | unsigned long uptime; | 674 | unsigned long uptime = uptime; |
675 | #endif | 675 | #endif |
676 | /* If we support any options, parse argv */ | 676 | /* If we support any options, parse argv */ |
677 | #if ENABLE_SELINUX || ENABLE_FEATURE_SHOW_THREADS || ENABLE_FEATURE_PS_WIDE || ENABLE_FEATURE_PS_LONG | 677 | #if ENABLE_SELINUX || ENABLE_FEATURE_SHOW_THREADS || ENABLE_FEATURE_PS_WIDE || ENABLE_FEATURE_PS_LONG |
@@ -802,9 +802,11 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
802 | 802 | ||
803 | { | 803 | { |
804 | int sz = terminal_width - len; | 804 | int sz = terminal_width - len; |
805 | char buf[sz + 1]; | 805 | if (sz >= 0) { |
806 | read_cmdline(buf, sz, p->pid, p->comm); | 806 | char buf[sz + 1]; |
807 | puts(buf); | 807 | read_cmdline(buf, sz, p->pid, p->comm); |
808 | puts(buf); | ||
809 | } | ||
808 | } | 810 | } |
809 | } | 811 | } |
810 | if (ENABLE_FEATURE_CLEAN_UP) | 812 | if (ENABLE_FEATURE_CLEAN_UP) |