OSDN Git Service

Cppcheck: Possible null pointer dereference: lpszString - otherwise it is redundant...
authorsdottaka <sdottaka@sourceforge.net>
Mon, 5 May 2014 15:40:14 +0000 (00:40 +0900)
committersdottaka <sdottaka@sourceforge.net>
Mon, 5 May 2014 15:40:14 +0000 (00:40 +0900)
--HG--
branch : stable

Src/FilepathEdit.cpp
Src/FilepathEdit.h

index 4f9b326..df516a3 100644 (file)
@@ -143,13 +143,12 @@ void CFilepathEdit::GetOriginalText(CString& rString) const
  * This function sets the text (original text) to show in the control.
  * The control may modify the text for displaying in the GUI.
  */
-void CFilepathEdit::SetOriginalText(LPCTSTR lpszString)
+void CFilepathEdit::SetOriginalText(const CString& szString)
 {
-       if (_tcscmp(m_sOriginalText, lpszString) == 0)
+       if (m_sOriginalText == szString)
                return;
 
-       if (lpszString != 0)
-               m_sOriginalText = lpszString;
+       m_sOriginalText = szString;
 
        RefreshDisplayText();
 }
index a182a0e..1ddcdf2 100644 (file)
@@ -45,7 +45,7 @@ public :
        LPCTSTR GetUpdatedTipText(CDC * pDC, int maxWidth);
 
        void SetActive(BOOL bActive);
-       void SetOriginalText(LPCTSTR lpszString );
+       void SetOriginalText(const CString& szString );
        void SetBackColor(COLORREF rgb);
        void SetTextColor(COLORREF rgb);