1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

better error handling

This commit is contained in:
Yann Collet
2016-09-09 19:33:56 +02:00
parent 746b51de51
commit a2664649df
8 changed files with 21 additions and 17 deletions

View File

@ -53,7 +53,7 @@ static void* loadFile_orDie(const char* fileName, size_t* size)
fprintf(stderr, "fread: %s : %s \n", fileName, strerror(errno));
exit(4);
}
fclose(inFile);
fclose(inFile); /* can't fail, read only */
*size = buffSize;
return buffer;
}
@ -101,7 +101,7 @@ static const char* createOutFilename_orDie(const char* filename)
{
size_t const inL = strlen(filename);
size_t const outL = inL + 5;
void* outSpace = malloc_orDie(outL);
void* const outSpace = malloc_orDie(outL);
memset(outSpace, 0, outL);
strcat(outSpace, filename);
strcat(outSpace, ".zst");