Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Libs/j3dcore/j3dhook.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ static inline bool J3DHookFunction(intptr_t pFuncAddr, void* pHookFunc)
*/
static inline bool J3DHookIsSkipped(const char* pName)
{
#ifdef _MSC_VER
#pragma warning(suppress : 4996) // getenv: only read
#endif
const char* pList = getenv("INDY_NOHOOK");
if ( !pList )
{
Expand Down
9 changes: 3 additions & 6 deletions Libs/sith/World/sithThing.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ static_assert(sizeof(CndThingSectionCounts) == 44, "sizeof(CndThingSectionCounts
// Copies a resource name into a CND name field (at most 63 characters, always terminated)
static void sithThing_CopyCndName(char* pDest, const char* pName)
{
strncpy(pDest, pName, 63);
pDest[63] = '\0';
stdUtil_StringCopy(pDest, 64, pName);
}

// INDY: reimplemented from v1.2 (Stage 3); verified by the differential suite "sithThing" (Scripts/indy/test_diff.sh).
Expand Down Expand Up @@ -808,8 +807,7 @@ int J3DAPI sithThing_ReadThingsListBinary(tFileHandle fh, SithWorld* pWorld, siz
sithThing_EnterSector(pThing, pSector, /*bNoWaterSplash=*/1, /*bNoNotify=*/1);
}

strncpy(pThing->aName, pInfo->aName, STD_ARRAYLEN(pThing->aName) - 1);
pThing->aName[STD_ARRAYLEN(pThing->aName) - 1] = '\0';
STD_STRCPY(pThing->aName, pInfo->aName);

pThing->flags = pInfo->flags & ~SITH_TF_SEEN;
pThing->type = pInfo->type;
Expand Down Expand Up @@ -1013,8 +1011,7 @@ int J3DAPI sithThing_ReadThingsListBinary(tFileHandle fh, SithWorld* pWorld, siz
pExplInfo->spriteEnd = pExplosion->spriteEndPos;
if ( pExplosion->aSpriteTemplateName[0] )
{
strncpy(pExplInfo->aSpriteTemplateName, pExplosion->aSpriteTemplateName, STD_ARRAYLEN(pExplInfo->aSpriteTemplateName) - 1);
pExplInfo->aSpriteTemplateName[STD_ARRAYLEN(pExplInfo->aSpriteTemplateName) - 1] = '\0';
STD_STRCPY(pExplInfo->aSpriteTemplateName, pExplosion->aSpriteTemplateName);
}
for ( size_t j = 0; j < STD_ARRAYLEN(pExplInfo->apDebries); j++ )
{
Expand Down
4 changes: 3 additions & 1 deletion Libs/smush/smushPlayWin32.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ void SmushPlatform_Wait(uint32_t usec)

void* SmushPlatform_OpenFile(const char* pFilename)
{
return fopen(pFilename, "rb");
FILE* pFile = NULL;
fopen_s(&pFile, pFilename, "rb");
return pFile;
}

size_t SmushPlatform_ReadFile(void* pFile, void* pBuffer, size_t size)
Expand Down
Loading