Merge pull request #598 from LegalizeAdulthood/cppcheck-null

Fix char buffer issues found by cppcheck
This commit is contained in:
Alexander Gessler
2015-07-05 13:46:54 +02:00
4 changed files with 45 additions and 21 deletions
+8 -4
View File
@@ -1320,8 +1320,10 @@ int CDisplay::HandleTreeViewPopup2(WPARAM wParam,LPARAM lParam)
{
// need to remove the file name
char* sz = strrchr(szFileName,'\\');
if (!sz)sz = strrchr(szFileName,'/');
if (!sz)*sz = 0;
if (!sz)
sz = strrchr(szFileName,'/');
if (sz)
*sz = 0;
}
OPENFILENAME sFilename1 = {
sizeof(OPENFILENAME),
@@ -1353,8 +1355,10 @@ int CDisplay::HandleTreeViewPopup2(WPARAM wParam,LPARAM lParam)
{
// need to remove the file name
char* sz = strrchr(szFileName,'\\');
if (!sz)sz = strrchr(szFileName,'/');
if (!sz)*sz = 0;
if (!sz)
sz = strrchr(szFileName,'/');
if (sz)
*sz = 0;
}
OPENFILENAME sFilename1 = {
sizeof(OPENFILENAME),