cc -Wextra

This commit is contained in:
Connor Lane Smith
2011-06-21 05:05:37 +01:00
parent 04162bd7b0
commit d7f9bda740
8 changed files with 22 additions and 19 deletions

8
nl.c
View File

@@ -7,7 +7,7 @@
#include "text.h"
#include "util.h"
static void nl(FILE *, const char *);
static void nl(FILE *);
static char mode = 't';
static const char *sep = "\t";
@@ -39,18 +39,18 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
if(optind == argc)
nl(stdin, "<stdin>");
nl(stdin);
else for(; optind < argc; optind++) {
if(!(fp = fopen(argv[optind], "r")))
eprintf("fopen %s:", argv[optind]);
nl(fp, argv[optind]);
nl(fp);
fclose(fp);
}
return EXIT_SUCCESS;
}
void
nl(FILE *fp, const char *str)
nl(FILE *fp)
{
char *buf = NULL;
long n = 0;