diff --git a/list.c b/list.c index e885305..1d4e074 100755 --- a/list.c +++ b/list.c @@ -48,9 +48,7 @@ char *joblist_headers() { } static int max(int a, int b) { - if (a > b) - return a; - return b; + return a > b ? a : b; } static const char *ofilename_shown(const struct Job *p) { @@ -124,7 +122,7 @@ static char *print_noresult(const struct Job *p) { if (line == NULL) error("Malloc for %i failed.\n", maxlen); - cmd_len = (term_width - maxlen) > 0 ? strlen(p->command) : 20; + cmd_len = max((strlen(p->command) + (term_width - maxlen)), 20); if (p->label) snprintf(line, maxlen, "%-4i %-10s %-20s %-8s %6s %-5d %s[%s]%s\n", p->jobid, @@ -205,7 +203,7 @@ static char *print_result(const struct Job *p) { } } - cmd_len = (term_width - maxlen) > 0 ? strlen(p->command) : 20; + cmd_len = max((strlen(p->command) + (term_width - maxlen)), 20); if (p->label) snprintf(line, maxlen, "%-4i %-10s %-20s %-8i %5.2f%s %-5d %s[%s]%s\n", p->jobid,