Fix bogus extra localization entries on Windows

Due to CRLF translation the value returned by fread in text mode can be less than the size of the file, leaving bogus data at the end of the buffer. Since the parser can already handle CRLF-terminated lines, and when reading directly from QuakeEX.kpf there would be no CRLF translation anyway, we can just open the file in binary mode.
This commit is contained in:
Andrei Drexler 2021-08-31 15:50:02 +03:00 committed by Ozkan Sezer
parent b61a736c8c
commit 9d7f9eac6f

View file

@ -2530,7 +2530,7 @@ void LOC_LoadFile (const char *file)
Con_Printf("\nLanguage initialization\n");
q_snprintf(path, sizeof(path), "%s/%s", com_basedir, file);
fp = fopen(path, "r");
fp = fopen(path, "rb");
if (!fp) goto fail;
fseek(fp, 0, SEEK_END);
i = ftell(fp);