From 24c63d1dd238ed762297786dbd2912f0bbaf941a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 8 Feb 2018 08:57:10 -0600 Subject: Thinko pointed out by Andreas Gampe (causing segfaults in top, oops). --- toys/posix/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys') diff --git a/toys/posix/ps.c b/toys/posix/ps.c index fd9b54bc..8ee68ad6 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1417,7 +1417,7 @@ static void top_common( mix.count = 0; while (old.count || new.count) { - struct carveup *otb = *old.tb, *ntb = *new.tb; + struct carveup *otb = old.tb ? *old.tb : 0, *ntb = new.tb ? *new.tb : 0; // If we just have old for this process, it exited. Discard it. if (old.count && (!new.count || *otb->slot < *ntb->slot)) { -- cgit v1.2.3