This commit is contained in:
Nishi 2025-11-17 18:20:56 +09:00
commit 85bc36e5b1
Signed by: nishi
GPG key ID: 27EF69B208EB9343
8 changed files with 42 additions and 18 deletions

View file

@ -2,21 +2,21 @@
#include <stdio.h>
void MDEFileCopy(const char* src, const char* dst){
char buffer[4096];
void MDEFileCopy(const char* src, const char* dst) {
char buffer[4096];
FILE* in;
FILE* out;
int r;
int r;
if((in = fopen(src, "rb")) == NULL) return;
if((out = fopen(dst, "wb")) == NULL){
if((out = fopen(dst, "wb")) == NULL) {
fclose(in);
return;
}
do{
do {
r = fread(buffer, 1, sizeof(buffer), in);
fwrite(buffer, 1, r, out);
}while(r == sizeof(buffer));
} while(r == sizeof(buffer));
fclose(in);
fclose(out);