From: Ian Darwin Date: Tue, 8 Sep 1992 22:32:35 +0000 (+0000) Subject: Christos's fix to his fix: make cfkputs() a function, not a macro. X-Git-Tag: FILE3_27~242 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1c99a104a9766ed98d799f6d89181c6b1ffb13c;p=file Christos's fix to his fix: make cfkputs() a function, not a macro. --- diff --git a/src/file.c b/src/file.c index 6ab39c31..2aa956f9 100644 --- a/src/file.c +++ b/src/file.c @@ -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 @@ -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"); +} diff --git a/src/file.h b/src/file.h index 71b87708..25c6dcec 100644 --- a/src/file.h +++ b/src/file.h @@ -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. @@ -30,10 +30,6 @@ #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 *));