minor style changes

This commit is contained in:
dwts 2014-04-22 13:43:01 +03:00 committed by sin
parent 59d0b5cd97
commit b700d5a8ed
3 changed files with 24 additions and 19 deletions

5
cat.c
View File

@ -25,7 +25,8 @@ main(int argc, char *argv[])
if(argc == 0) { if(argc == 0) {
concat(stdin, "<stdin>", stdout, "<stdout>"); concat(stdin, "<stdin>", stdout, "<stdout>");
} else for(i = 0; i < argc; i++) { } else {
for(i = 0; i < argc; i++) {
if(!(fp = fopen(argv[i], "r"))) { if(!(fp = fopen(argv[i], "r"))) {
weprintf("fopen %s:", argv[i]); weprintf("fopen %s:", argv[i]);
continue; continue;
@ -33,6 +34,6 @@ main(int argc, char *argv[])
concat(fp, argv[i], stdout, "<stdout>"); concat(fp, argv[i], stdout, "<stdout>");
fclose(fp); fclose(fp);
} }
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

4
fold.c
View File

@ -44,7 +44,8 @@ main(int argc, char *argv[])
if(argc == 0) { if(argc == 0) {
fold(stdin, width); fold(stdin, width);
} else for(; argc > 0; argc--, argv++) { } else {
for(; argc > 0; argc--, argv++) {
if(!(fp = fopen(argv[0], "r"))) { if(!(fp = fopen(argv[0], "r"))) {
weprintf("fopen %s:", argv[0]); weprintf("fopen %s:", argv[0]);
continue; continue;
@ -52,6 +53,7 @@ main(int argc, char *argv[])
fold(fp, width); fold(fp, width);
fclose(fp); fclose(fp);
} }
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

4
head.c
View File

@ -32,7 +32,8 @@ main(int argc, char *argv[])
if(argc == 0) { if(argc == 0) {
head(stdin, "<stdin>", n); head(stdin, "<stdin>", n);
} else for(; argc > 0; argc--, argv++) { } else {
for(; argc > 0; argc--, argv++) {
if(!(fp = fopen(argv[0], "r"))) { if(!(fp = fopen(argv[0], "r"))) {
weprintf("fopen %s:", argv[0]); weprintf("fopen %s:", argv[0]);
continue; continue;
@ -40,6 +41,7 @@ main(int argc, char *argv[])
head(fp, argv[0], n); head(fp, argv[0], n);
fclose(fp); fclose(fp);
} }
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }