home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
PROGRAMM
/
SNIP0492.ZIP
/
FERRORF.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-05
|
666b
|
25 lines
/* FERRORF.C
** Prints error message with printf() formatting syntax, then a colon,
** then a message corressponding to the value of errno, then a newline.
** Output is to filehandle.
**
** Public Domain by Mark R. Devlin, free usage is permitted.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
int ferrorf(FILE *filehandle, const char *format, ...)
{
int vfp, fp;
va_list vargs;
vfp = fp = 0;
va_start(vargs, format);
vfp = vfprintf(filehandle, format, vargs);
va_end(vargs);
fp = fprintf(filehandle, ": %s\n", sys_errlist[errno]);
return ((vfp==EOF || fp==EOF) ? EOF : (vfp+fp));
}