Skip to content

Commit

Permalink
Improved error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
SzAkos04 committed Apr 20, 2024
1 parent 31b84c6 commit 0be0bf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cat/cat.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(int argc, char **argv) {
}
break;
default:
fprintf(stderr, "unknown argument `-%c`", argv[i][j]);
fprintf(stderr, "unknown argument `%s`", argv[i]);
free(paths);
return 1;
}
Expand Down Expand Up @@ -262,7 +262,7 @@ int print_file(char *buf) {
int len = strlen(buf);
for (int i = 0; i < len; ++i) {
// higher priority
// NOTE: not the prettiest code, but it works, so don't touch it
// NOTE: not the prettiest code, but it works
if (squeeze_blank && buf[i] == '\n') {
// skip over consecutive '\n' characters
if (i + 1 < len && buf[i + 1] == '\n') {
Expand Down

0 comments on commit 0be0bf9

Please sign in to comment.