ADD: Holimans new changes in master.

This commit is contained in:
iceman1001
2015-01-05 02:01:24 +01:00
parent f0cf62cd73
commit d3a22c7dfa
23 changed files with 488 additions and 321 deletions

View File

@@ -79,6 +79,7 @@ int saveFile(const char *preferredName, const char *suffix, const void* data, si
FILE *fh=fopen(fileName,"wb");
if(!fh) {
PrintAndLog("Failed to write to file '%s'", fileName);
free(fh);
return 1;
}
fwrite(data, 1, datalen, fh);
@@ -94,10 +95,12 @@ int loadFile(const char *fileName, void* data, size_t datalen)
FILE *filehandle = fopen(fileName, "rb");
if(!filehandle) {
PrintAndLog("Failed to read from file '%s'", fileName);
free(filehandle);
return 1;
}
fread(data,datalen,1,filehandle);
fclose(filehandle);
free(filehandle);
return 0;
}
/**