diff --git a/src/cmd.cpp b/src/cmd.cpp index de49aa0..b98e8ec 100644 --- a/src/cmd.cpp +++ b/src/cmd.cpp @@ -25,7 +25,7 @@ #include //atol cmd_args::cmd_args(void)noexcept: - truecol(0), color(0), number(0), ends(0), squeeze(0), tabs(0), nonprinting(0), error(0), usage(0), version(0){} + truecol(0), color(0), number(0), ends(0), squeeze(0), tabs(0), nonprinting(0), treatbinary(0), error(0), usage(0), version(0){} void cmd_args::clear_gnu_options(void){ number = PRINT_LINE_NEVER; ends = squeeze = tabs = nonprinting = 0; diff --git a/src/roflcat.cpp b/src/roflcat.cpp index 5e27f52..d7dee88 100644 --- a/src/roflcat.cpp +++ b/src/roflcat.cpp @@ -187,7 +187,7 @@ int real_print_files(const cmd_args& args){ if(args.treatbinary){ //Don't check if buf is empty because that's not how GNU cat handles Ctrl+D in middle of line - for(int in;(in = fgetc(stdin)) != WEOF;){ + for(int in;(in = fgetc(stdin)) != EOF;){ p.print(static_cast(in)); if(in == L'\n') //Only reset on newline to save print overhead p.reset(); @@ -210,13 +210,13 @@ int real_print_files(const cmd_args& args){ } if(args.treatbinary){ if(args.nonprinting){ - for(int in;(in = fgetc(fp)) != WEOF;){ + for(int in;(in = fgetc(fp)) != EOF;){ char tmp[5]; nonprinting_notation(in, tmp); p.print(tmp); } }else{ - for(int in;(in = fgetc(fp)) != WEOF;) + for(int in;(in = fgetc(fp)) != EOF;) p.print(static_cast(in)); } }else{ @@ -276,6 +276,5 @@ int main(int argc, char** argv){ }else if(avail_colors == 256){ return print_files>(args); } - return 0; }