(detect_loop): There's no loop if k->top is NULL.
authorJim Meyering <jim@meyering.net>
Sun, 22 Aug 1999 16:10:24 +0000 (16:10 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 22 Aug 1999 16:10:24 +0000 (16:10 +0000)
src/tsort.c

index 0b36a33683ee1dac20b6aa85d03ba2b44aa09b1f..f26cfa3950ae1666912bc7b92928d12a59a49a91 100644 (file)
@@ -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)
        {