Switching to VS2017 compiler has found a bug in pofile.c

This commit is contained in:
Enno Rehling 2018-10-14 14:45:05 +02:00
parent a7b9f6dc3e
commit f247224844
3 changed files with 7 additions and 4 deletions

View File

@ -77,7 +77,7 @@ int pofile_read(const char *filename, int (*callback)(const char *msgid, const c
int err = sscanf(line, "%8s", token);
if (err == 1) {
char *text = NULL;
size_t size, len = strlen(token);
size_t size = 0, len = strlen(token);
line = line + len + 1;
if (len == 7 && memcmp(token, "msgctxt", 7) == 0) {
@ -99,7 +99,7 @@ int pofile_read(const char *filename, int (*callback)(const char *msgid, const c
msgid[0] = 0;
}
}
if (text) {
if (size > 0) {
line = read_multiline(F, line, text, size);
}
}

View File

@ -3,7 +3,8 @@ IF EXIST ..\build-vs10 SET BUILD=..\build-vs10\eressea\Debug
IF EXIST ..\build-vs11 SET BUILD=..\build-vs11\eressea\Debug
IF EXIST ..\build-vs12 SET BUILD=..\build-vs12\eressea\Debug
IF EXIST ..\build-vs14 SET BUILD=..\build-vs14\eressea\Debug
REM IF EXIST ..\build-vs15 SET BUILD=..\build-vs15\eressea\Debug
IF EXIST ..\build-vs15 SET BUILD=..\build-vs15\eressea\Debug
SET SERVER=%BUILD%\eressea.exe
%BUILD%\test_eressea.exe
%SERVER% ..\scripts\run-tests.lua

View File

@ -1,5 +1,7 @@
@ECHO OFF
SET VSVERSION=14
SET VSVERSION=15
IF NOT "%1" == "" SET VSVERSION=%1%
SET SRCDIR=%CD%
CD ..
SET ERESSEA=%CD%