mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
Hoist strlen() outside loop in kzopen()
git-svn-id: https://svn.eduke32.com/eduke32@7025 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a677b18b2d
commit
eeba7847eb
1 changed files with 5 additions and 2 deletions
|
@ -2632,11 +2632,14 @@ intptr_t kzopen(const char *filnam)
|
|||
}
|
||||
|
||||
//Finally, check mounted dirs
|
||||
|
||||
int const namlen = strlen(filnam);
|
||||
|
||||
for (i=kzdirnamhead; i>=0; i=B_UNBUF32(&kzhashbuf[i]))
|
||||
{
|
||||
strcpy(tempbuf,&kzhashbuf[i+4]);
|
||||
j = strlen(tempbuf);
|
||||
if (strlen(filnam)+1+j >= sizeof(tempbuf)) continue; //don't allow int32_t filenames to buffer overrun
|
||||
uint32_t const j = strlen(tempbuf);
|
||||
if (namlen+1+j >= sizeof(tempbuf)) continue; //don't allow int32_t filenames to buffer overrun
|
||||
if ((j) && (tempbuf[j-1] != '/') && (tempbuf[j-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\'))
|
||||
#if defined(_WIN32)
|
||||
strcat(tempbuf,"\\");
|
||||
|
|
Loading…
Reference in a new issue