Add weprintf() and replace fprintf(stderr, ...) calls
There is still some programs left to be updated for this. Many of these programs would stop on the first file that they could not open.
This commit is contained in:
4
head.c
4
head.c
@@ -1,5 +1,4 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -35,8 +34,7 @@ main(int argc, char *argv[])
|
||||
head(stdin, "<stdin>", n);
|
||||
} else for(; argc > 0; argc--, argv++) {
|
||||
if(!(fp = fopen(argv[0], "r"))) {
|
||||
fprintf(stderr, "fopen %s: %s\n", argv[0],
|
||||
strerror(errno));
|
||||
weprintf("fopen %s:", argv[0]);
|
||||
continue;
|
||||
}
|
||||
head(fp, argv[0], n);
|
||||
|
Reference in New Issue
Block a user