From: millert Date: Wed, 22 Jan 1997 05:49:19 +0000 (+0000) Subject: Off by one error. Fixes a core dump. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba0a17509ff7219082828fc68a4fe31312409faa;p=openbsd Off by one error. Fixes a core dump. --- diff --git a/usr.bin/sort/fsort.c b/usr.bin/sort/fsort.c index 8365edde872..122608ae646 100644 --- a/usr.bin/sort/fsort.c +++ b/usr.bin/sort/fsort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsort.c,v 1.1 1997/01/20 19:39:51 millert Exp $ */ +/* $OpenBSD: fsort.c,v 1.2 1997/01/22 05:49:19 millert Exp $ */ /*- * Copyright (c) 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)fsort.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: fsort.c,v 1.1 1997/01/20 19:39:51 millert Exp $"; +static char rcsid[] = "$OpenBSD: fsort.c,v 1.2 1997/01/22 05:49:19 millert Exp $"; #endif #endif /* not lint */ @@ -97,7 +97,7 @@ fsort(binno, depth, infiles, nfiles, outfp, ftbl) if (!SINGL_FLD) linebuf = malloc(MAXLLEN); } - bufend = buffer + BUFSIZE; + bufend = buffer + BUFSIZE - 1; if (binno >= 0) { tfiles.top = infiles.top + nfiles; get = getnext;