Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/sort improve previous slightly - need >= (not just >...



details:   https://anonhg.NetBSD.org/src/rev/171e8be937b4
branches:  trunk
changeset: 540797:171e8be937b4
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Dec 24 15:15:01 2002 +0000

description:
improve previous slightly - need >= (not just >) in CHECKFSTACK()

diffstat:

 usr.bin/sort/fsort.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 5ac03248d085 -r 171e8be937b4 usr.bin/sort/fsort.c
--- a/usr.bin/sort/fsort.c      Tue Dec 24 15:09:27 2002 +0000
+++ b/usr.bin/sort/fsort.c      Tue Dec 24 15:15:01 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fsort.c,v 1.23 2002/12/24 14:43:37 jdolecek Exp $      */
+/*     $NetBSD: fsort.c,v 1.24 2002/12/24 15:15:01 jdolecek Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -47,7 +47,7 @@
 #include "fsort.h"
 
 #ifndef lint
-__RCSID("$NetBSD: fsort.c,v 1.23 2002/12/24 14:43:37 jdolecek Exp $");
+__RCSID("$NetBSD: fsort.c,v 1.24 2002/12/24 15:15:01 jdolecek Exp $");
 __SCCSID("@(#)fsort.c  8.1 (Berkeley) 6/6/93");
 #endif /* not lint */
 
@@ -64,7 +64,7 @@
 struct tempfile fstack[MAXFCT];
 #define MSTART         (MAXFCT - MERGE_FNUM)
 #define        CHECKFSTACK(n)                                  \
-       if (n > MAXFCT)                                 \
+       if (n >= MAXFCT)                                \
                errx(2, "fstack: too many temporary files; use -H or sort in pieces")
        
 #define SALIGN(n) ((n+sizeof(length_t)-1) & ~(sizeof(length_t)-1))
@@ -222,7 +222,7 @@
                                }
                        } else {
                                CHECKFSTACK(base + ntfiles);
-                               fstack[base + ntfiles].fp= ftmp();
+                               fstack[base + ntfiles].fp = ftmp();
                                onepass(keylist, depth, nelem, sizes,
                                    weights, fstack[base + ntfiles].fp);
                                ntfiles++;



Home | Main Index | Thread Index | Old Index