From 9d7f9eac6f3a05c2be227eb12da461dc018a3da1 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Tue, 31 Aug 2021 15:50:02 +0300 Subject: [PATCH] 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. --- Quake/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Quake/common.c b/Quake/common.c index 6206c3fe..df8edb3f 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -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);