Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Aug 11, 2023
1 parent 6146b79 commit 020d790
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Quake/mkpak.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void ReportFileError(const char* operation, const char* fileName)

static int BuildPakFile(const char* pakFileName, char** inputFileNames, size_t inputFilesCount)
{
static const size_t MAX_FILENAME_LENGTH = 56;
enum DummyEnum { MAX_FILENAME_LENGTH = 56 };

for (size_t i = 0; i < inputFilesCount; ++i)
{
Expand All @@ -39,7 +39,7 @@ static int BuildPakFile(const char* pakFileName, char** inputFileNames, size_t i

if (inputFileNameLength > MAX_FILENAME_LENGTH)
{
printf("ERROR: File name %s is too long, %zu > %zu\n", inputFileName, inputFileNameLength, MAX_FILENAME_LENGTH);
printf("ERROR: File name %s is too long, %zu > %i\n", inputFileName, inputFileNameLength, MAX_FILENAME_LENGTH);
return -1;
}
}
Expand Down Expand Up @@ -128,14 +128,14 @@ static int BuildPakFile(const char* pakFileName, char** inputFileNames, size_t i
return -10;
}

free(buffer);

if (fwrite(buffer, 1, inputFileSize, pakFile) != inputFileSize)
{
ReportFileError("write content to output", pakFileName);
return -11;
}

free(buffer);

if (fclose(inputFile) != 0)
{
ReportFileError("close input", inputFileName);
Expand Down

0 comments on commit 020d790

Please sign in to comment.