]> granicus.if.org Git - file/commitdiff
off by one in nbytes
authorChristos Zoulas <christos@zoulas.com>
Thu, 16 Sep 1993 20:45:46 +0000 (20:45 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 16 Sep 1993 20:45:46 +0000 (20:45 +0000)
src/file.c

index 7de0ea572733362f4d4fbff9fa6d3de77782a09c..3a013a2f1c083d5926b3d29426ca1b6b13494133 100644 (file)
@@ -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 <stdio.h>
@@ -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);
        }