# HG changeset patch # User Paper # Date 1653192490 14400 # Node ID 652343b56a6079459d97d9e7501c030c8ca9f965 # Parent 7cb4ca7cf257039a708524974756eca942275953 Remove the need for and diff -r 7cb4ca7cf257 -r 652343b56a60 Makefile --- a/Makefile Sat May 21 18:41:54 2022 -0400 +++ b/Makefile Sun May 22 00:08:10 2022 -0400 @@ -9,7 +9,7 @@ # GUI is windows-only, please use cross-compiler! gui: src/gui.o src/common.o - $(CC) -o $@ $^ $(CC_FLAGS) $(LD_FLAGS) -mwindows + $(CC) -o $@ $^ $(CC_FLAGS) $(LD_FLAGS) -mwindows -fstack-protector clean: rm -f src/*.o *.exe msvpvf gui diff -r 7cb4ca7cf257 -r 652343b56a60 include/common.h --- a/include/common.h Sat May 21 18:41:54 2022 -0400 +++ b/include/common.h Sun May 22 00:08:10 2022 -0400 @@ -1,2 +1,2 @@ -void set_data(unsigned char magic[], uint16_t version, FILE* target); -int copy_file(char* source_file, char* target_file); \ No newline at end of file +void set_data(unsigned char magic[], int version, FILE* target); +int copy_file(char* source_file, char* target_file); diff -r 7cb4ca7cf257 -r 652343b56a60 src/common.c --- a/src/common.c Sat May 21 18:41:54 2022 -0400 +++ b/src/common.c Sun May 22 00:08:10 2022 -0400 @@ -27,7 +27,7 @@ return 1; } - while (fgetc(source) != EOF) { + while (!feof(source)) { size_t b = fread(ch, 1, sizeof(ch), source); if (b) fwrite(ch, 1, b, target); diff -r 7cb4ca7cf257 -r 652343b56a60 src/main.c --- a/src/main.c Sat May 21 18:41:54 2022 -0400 +++ b/src/main.c Sun May 22 00:08:10 2022 -0400 @@ -1,5 +1,3 @@ -#include -#include #include #include #include