diff options
Diffstat (limited to 'rushs/tinyprintf/io_merge_files/merge_files.c')
| -rw-r--r-- | rushs/tinyprintf/io_merge_files/merge_files.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/rushs/tinyprintf/io_merge_files/merge_files.c b/rushs/tinyprintf/io_merge_files/merge_files.c deleted file mode 100644 index 26ac9cf..0000000 --- a/rushs/tinyprintf/io_merge_files/merge_files.c +++ /dev/null @@ -1,31 +0,0 @@ -#define _POSIX_C_SOURCE 200809L - -#include <stdio.h> - -int merge_files(const char *file_1, const char *file_2) -{ - FILE *a = fopen(file_1, "a"); - if (a == NULL) - { - return -1; - } - FILE *r = fopen(file_2, "r"); - if (r == NULL) - { - return -1; - } - - int c; - while ((c = fgetc(r)) != EOF) - { - if (fputc(c, a) == EOF) - { - return -1; - } - } - - fclose(a); - fclose(r); - - return 0; -} |
