]> granicus.if.org Git - file/commitdiff
Christos's fix to his fix: make cfkputs() a function, not a macro.
authorIan Darwin <ian@darwinsys.com>
Tue, 8 Sep 1992 22:32:35 +0000 (22:32 +0000)
committerIan Darwin <ian@darwinsys.com>
Tue, 8 Sep 1992 22:32:35 +0000 (22:32 +0000)
src/file.c
src/file.h

index 6ab39c319151387e88446e87a247b551fb515d8f..2aa956f9c72575a110df645b4e91b0213c93c6ae 100644 (file)
@@ -26,7 +26,7 @@
  */
 #ifndef        lint
 static char *moduleid = 
-       "@(#)$Id: file.c,v 1.22 1992/09/08 15:36:41 ian Exp $";
+       "@(#)$Id: file.c,v 1.23 1992/09/08 22:32:35 ian Exp $";
 #endif /* lint */
 
 #include <stdio.h>
@@ -266,3 +266,12 @@ int nb;
                 */
                ckfputs("data", stdout);
 }
+
+void
+ckfputs(str, fil)      
+    const char *str;
+    FILE *fil;
+{
+       if (fputs(str,fil) == EOF)
+               error("write failed.\n");
+}
index 71b8770884335affcc836bde1d69940eb0465c4a..25c6dcec57094849e097782f7ffd7990d5023b24 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * file.h - definitions for file(1) program
- * @(#)$Id: file.h,v 1.10 1992/09/08 14:58:34 ian Exp $
+ * @(#)$Id: file.h,v 1.11 1992/09/08 22:33:06 ian Exp $
  *
  * Copyright (c) Ian F. Darwin, 1987.
  * Written by Ian F. Darwin.
 #define MAXMAGIS 1000          /* max entries in /etc/magic */
 #define MAXDESC        50              /* max leng of text description */
 #define MAXstring 32           /* max leng of "string" types */
-#define ckfputs(str,fil)       if (fputs(str,fil)==EOF)                \
-                                       error("write failed.\n");       \
-                               else                                    \
-                                       str[0] = str[0]
 
 struct magic {
        short flag;             
@@ -78,6 +74,7 @@ struct magic {
 extern int   apprentice                __P((char *, int));
 extern int   ascmagic          __P((unsigned char *, int));
 extern void  error             __P((const char *, ...));
+extern void  ckfputs           __P((const char *, FILE *));
 struct stat;
 extern int   fsmagic           __P((const char *, struct stat *));
 extern int   is_compress       __P((const unsigned char *, int *));