From: Jim Meyering Date: Sun, 22 Aug 1999 16:10:24 +0000 (+0000) Subject: (detect_loop): There's no loop if k->top is NULL. X-Git-Tag: FILEUTILS-4_0j-trial~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53e173cca675e35beda54a96641441b33c8cd0b9;p=thirdparty%2Fcoreutils.git (detect_loop): There's no loop if k->top is NULL. --- diff --git a/src/tsort.c b/src/tsort.c index 0b36a33683..f26cfa3950 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -315,7 +315,7 @@ scan_zeros (struct item *k) static void detect_loop (struct item *k) { - if (k->count > 0) + if (k->count > 0 && k->top) { while (k && k->count > 0) {