From d1c99a104a9766ed98d799f6d89181c6b1ffb13c Mon Sep 17 00:00:00 2001 From: Ian Darwin Date: Tue, 8 Sep 1992 22:32:35 +0000 Subject: [PATCH] Christos's fix to his fix: make cfkputs() a function, not a macro. --- src/file.c | 11 ++++++++++- src/file.h | 7 ++----- 2 files changed, 12 insertions(+), 6 deletions(-) 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 *)); -- 2.40.0