OSDN Git Service

Fix runtime error "string iterator not dereferencable"
authorsdottaka <none@none>
Mon, 4 Feb 2013 07:19:22 +0000 (23:19 -0800)
committersdottaka <none@none>
Mon, 4 Feb 2013 07:19:22 +0000 (23:19 -0800)
Src/ChildFrm.cpp
Src/DirFrame.cpp
Src/HexMergeFrm.cpp
Src/MainFrm.cpp
Src/OpenFrm.cpp

index 6b527ae..1d167fe 100644 (file)
@@ -440,7 +440,7 @@ void CChildFrame::GetMessageString(UINT nID, CString& rMessage) const
 {
        // load appropriate string
        const String s = theApp.LoadString(nID);
-       if (!AfxExtractSubString(rMessage, &*s.begin(), 0))
+       if (!AfxExtractSubString(rMessage, s.c_str(), 0))
        {
                // not found
                TRACE1("Warning: no message line prompt for ID 0x%04X.\n", nID);
index 21e4326..57223f2 100644 (file)
@@ -161,7 +161,7 @@ void CDirFrame::GetMessageString(UINT nID, CString& rMessage) const
 {
        // load appropriate string
        const String s = theApp.LoadString(nID);
-       if (!AfxExtractSubString(rMessage, &*s.begin(), 0))
+       if (!AfxExtractSubString(rMessage, s.c_str(), 0))
        {
                // not found
                TRACE1("Warning: no message line prompt for ID 0x%04X.\n", nID);
index 0e42dcf..b493962 100644 (file)
@@ -227,7 +227,7 @@ void CHexMergeFrame::GetMessageString(UINT nID, CString& rMessage) const
 {
        // load appropriate string
        const String s = theApp.LoadString(nID);
-       if (!AfxExtractSubString(rMessage, &*s.begin(), 0))
+       if (!AfxExtractSubString(rMessage, s.c_str(), 0))
        {
                // not found
                TRACE1("Warning: no message line prompt for ID 0x%04X.\n", nID);
index aa78329..629c6ca 100644 (file)
@@ -1817,7 +1817,7 @@ void CMainFrame::GetMessageString(UINT nID, CString& rMessage) const
        const String s = theApp.LoadString(nID);
 
        // avoid dereference of empty strings
-       if (s.length() <= 0 || !AfxExtractSubString(rMessage, &*s.begin(), 0))
+       if (s.length() <= 0 || !AfxExtractSubString(rMessage, s.c_str(), 0))
        {
                // not found
                TRACE1("Warning: no message line prompt for ID 0x%04X.\n", nID);
index 907a0b1..769acea 100644 (file)
@@ -140,7 +140,7 @@ void COpenFrame::GetMessageString(UINT nID, CString& rMessage) const
 {
        // load appropriate string
        const String s = theApp.LoadString(nID);
-       if (!AfxExtractSubString(rMessage, &*s.begin(), 0))
+       if (!AfxExtractSubString(rMessage, s.c_str(), 0))
        {
                // not found
                TRACE1("Warning: no message line prompt for ID 0x%04X.\n", nID);