From e118fd7ebb66e8adb475b643f3ec978c9b2b163e Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Fri, 3 Nov 2017 15:49:21 +0530 Subject: [PATCH] fix "ps -l" fix segfault when executing "ps -l". Signed-off-by: Vinayak Menon --- task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task.c b/task.c index 5754159..f2628b7 100644 --- a/task.c +++ b/task.c @@ -3485,7 +3485,7 @@ show_last_run(struct task_context *tc, struct psinfo *psi) sprintf(format, "[%c%dll%c] ", '%', c, pc->output_radix == 10 ? 'u' : 'x'); - if (psi) { + if (psi && psi->cpus) { for (c = others = 0; c < kt->cpus; c++) { if (!NUM_IN_BITMAP(psi->cpus, c)) continue; --