summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-08-22 16:10:24 +0000
committerJim Meyering <jim@meyering.net>1999-08-22 16:10:24 +0000
commit53e173cca675e35beda54a96641441b33c8cd0b9 (patch)
tree898ca224a40800bbcc25ddf8aedfc3ee08a28a36 /src
parent5157fd957eb87c7ba0b20485f125048c50a751ab (diff)
downloadcoreutils-53e173cca675e35beda54a96641441b33c8cd0b9.tar.xz
(detect_loop): There's no loop if k->top is NULL.
Diffstat (limited to 'src')
-rw-r--r--src/tsort.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tsort.c b/src/tsort.c
index 0b36a3368..f26cfa395 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)
{