From: Christos Zoulas Date: Thu, 16 Sep 1993 20:45:46 +0000 (+0000) Subject: off by one in nbytes X-Git-Tag: FILE3_27~151 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b6a9ca61da11834047572083fc988ae13420a6a;p=file off by one in nbytes --- diff --git a/src/file.c b/src/file.c index 7de0ea57..3a013a2f 100644 --- a/src/file.c +++ b/src/file.c @@ -26,7 +26,7 @@ */ #ifndef lint static char *moduleid = - "@(#)$Id: file.c,v 1.26 1993/02/19 14:22:45 ian Exp $"; + "@(#)$Id: file.c,v 1.27 1993/09/16 20:45:46 christos Exp $"; #endif /* lint */ #include @@ -234,7 +234,7 @@ int wid; if (nbytes == 0) ckfputs("empty", stdout); else { - buf[nbytes] = '\0'; /* null-terminate it */ + buf[nbytes++] = '\0'; /* null-terminate it */ tryit(buf, nbytes); }