]> granicus.if.org Git - file/commitdiff
Add a cautionary check to warning() - don't print progname if it's == NULL.
authorIan Darwin <ian@darwinsys.com>
Fri, 6 Nov 1987 17:26:01 +0000 (17:26 +0000)
committerIan Darwin <ian@darwinsys.com>
Fri, 6 Nov 1987 17:26:01 +0000 (17:26 +0000)
src/print.c

index 17075ae3e9941ac7b26e27b2d510fbad9ebf3d20..773d5267ee40a587ddef9698ee268bbd63f98eb2 100644 (file)
@@ -31,7 +31,7 @@
 
 #ifndef        lint
 static char *moduleid = 
-       "@(#)$Header: /home/glen/git/file/cvs/file/src/print.c,v 1.7 1987/10/14 08:36:55 ian Exp $";
+       "@(#)$Header: /home/glen/git/file/cvs/file/src/print.c,v 1.8 1987/11/06 17:26:01 ian Exp $";
 #endif /* lint */
 
 #define MAXSTR         500
@@ -78,7 +78,8 @@ char *f, *a;
        int myerrno;
 
        myerrno = errno;
-       (void) fputs(progname, stderr);
+       if (progname != NULL)
+               (void) fputs(progname, stderr);
        (void) putc(':', stderr);
        (void) putc(' ', stderr);
        (void) fprintf(stderr, f, a);