]> granicus.if.org Git - file/commitdiff
Handle case where read of HOWMANY from file returns zero!
authorIan Darwin <ian@darwinsys.com>
Thu, 12 Nov 1987 12:57:50 +0000 (12:57 +0000)
committerIan Darwin <ian@darwinsys.com>
Thu, 12 Nov 1987 12:57:50 +0000 (12:57 +0000)
src/file.c

index 794ed9fd23667b52a7a92cd29116a3d47074d9c8..e0cc6f45e324bda8e47831d2200cf97b3317fa32 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef        lint
 static char *moduleid = 
-       "@(#)$Header: /home/glen/git/file/cvs/file/src/file.c,v 1.12 1987/11/06 21:03:16 ian Exp $";
+       "@(#)$Header: /home/glen/git/file/cvs/file/src/file.c,v 1.13 1987/11/12 12:57:50 ian Exp $";
 #endif /* lint */
 extern char *ckfmsg;
 int    debug = 0,      /* huh? */
@@ -167,6 +167,9 @@ readit:
                 */
                if ((nbytes = read(fd, buf, HOWMANY)) == -1)
                        warning("read failed");
+               if (nbytes == 0) {
+                       ckfputs("empty", stdout);
+               } else
                /*
                 * try tests in /etc/magic (or surrogate magic file)
                 */