Bug 58221 don't use strlen to check if a string is of length 0
patch by aaronl@vitelus.com r=timeless sr=bz git-svn-id: svn://10.0.0.236/trunk@133999 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -331,7 +331,7 @@ void Logger::setOnTop(BOOL ontop)
|
||||
|
||||
void Logger::setToFile(BOOL tofile, char * filename)
|
||||
{
|
||||
if(!filename || (strlen(filename) == 0) || (strlen(filename) > _MAX_PATH))
|
||||
if(!filename || !*filename || (strlen(filename) > _MAX_PATH))
|
||||
{
|
||||
bToFile = FALSE;
|
||||
return;
|
||||
|
||||
@@ -123,7 +123,7 @@ void CPluginBase::getLogFileName(LPSTR szLogFileName, int iSize)
|
||||
getModulePath(szFileName, sizeof(szFileName));
|
||||
strcat(szFileName, szINIFile);
|
||||
XP_GetPrivateProfileString(SECTION_LOG, KEY_FILE_NAME, "", szLogFileName, (DWORD)iSize, szFileName);
|
||||
if(strlen(szLogFileName) == 0)
|
||||
if(!*szLogFileName)
|
||||
{
|
||||
strcpy(szLogFileName, m_szScriptCacheFile);
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ int XP_GetPrivateProfileInt(LPSTR szSection, LPSTR szKey, int iDefault, LPSTR sz
|
||||
#else
|
||||
static char szString[80];
|
||||
XP_GetPrivateProfileString(szSection, szKey, "", szString, sizeof(szString), szFileName);
|
||||
if(strlen(szString) == 0)
|
||||
if(!*szString)
|
||||
return iDefault;
|
||||
int iRet = atoi(szString);
|
||||
return iRet;
|
||||
|
||||
Reference in New Issue
Block a user