From 2b01ea19b16c01e615f0809b96d91c749b77be68 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 25 Oct 2018 23:30:41 +0000 Subject: [PATCH] Shut up a warning about potentially passing a null ptr to strlen() by way of a bad FILE ptr. The condition wasn't actually possible, but this is just as or more correct than it was before. This sure is a long commit message for something that only adds an 'else'. git-svn-id: https://svn.eduke32.com/eduke32@7099 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/savegame.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 51d2a5c69..599bedc47 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -728,8 +728,7 @@ static uint8_t *writespecdata(const dataspec_t *spec, FILE *fil, uint8_t *dump) if (!fil && (sp->flags&(DS_NOCHK|DS_CMP|DS_STRING))) continue; - - if (sp->flags&DS_STRING) + else if (sp->flags&DS_STRING) { fwrite(sp->ptr, Bstrlen((const char *)sp->ptr), 1, fil); // not null-terminated! continue;