Add xputs() to detect EOF on writes.
This commit is contained in:
parent
7aa9d8fbf1
commit
5084feadff
@ -155,6 +155,11 @@ void xprintf(char *format, ...)
|
|||||||
if (ferror(stdout)) perror_exit("write");
|
if (ferror(stdout)) perror_exit("write");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xputs(char *s)
|
||||||
|
{
|
||||||
|
if (EOF == puts(s)) perror_exit("write");
|
||||||
|
}
|
||||||
|
|
||||||
void xputc(char c)
|
void xputc(char c)
|
||||||
{
|
{
|
||||||
if (EOF == fputc(c, stdout)) perror_exit("write");
|
if (EOF == fputc(c, stdout)) perror_exit("write");
|
||||||
|
@ -48,6 +48,7 @@ void *xstrndup(char *s, size_t n);
|
|||||||
void *xstrdup(char *s);
|
void *xstrdup(char *s);
|
||||||
char *xmsprintf(char *format, ...);
|
char *xmsprintf(char *format, ...);
|
||||||
void xprintf(char *format, ...);
|
void xprintf(char *format, ...);
|
||||||
|
void xputs(char *s);
|
||||||
void xputc(char c);
|
void xputc(char c);
|
||||||
void xflush(void);
|
void xflush(void);
|
||||||
void xexec(char **argv);
|
void xexec(char **argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user