From b2a64291ba1658b737df90791a413948dbcd321c Mon Sep 17 00:00:00 2001 From: George Tasker Date: Wed, 2 Aug 2000 10:44:55 +0000 Subject: [PATCH] Change return value of GetExtendedDBErrorMsg2 to be a const char * instead of char *. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/db/listdb.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/db/listdb.cpp b/samples/db/listdb.cpp index 57e48dd087..ff098100ba 100644 --- a/samples/db/listdb.cpp +++ b/samples/db/listdb.cpp @@ -93,9 +93,10 @@ const int LISTDB_NO_SPACES_BETWEEN_COLS = 3; * NOTE: The value returned by this function is for temporary use only and * should be copied for long term use */ -char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine) +const char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine) { static wxString msg; + msg = ""; wxString tStr; @@ -128,12 +129,15 @@ char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine) msg.Append(pDbList->PtrDb->errorList[i]); if (wxStrcmp(pDbList->PtrDb->errorList[i],"") != 0) msg.Append("\n"); + // Clear the errmsg buffer so the next error will not + // end up showing the previous error that have occurred + wxStrcpy(pDbList->PtrDb->errorList[i],""); } } } msg += "\n"; - return (char*) (const char*) msg; + return /*(char*) (const char*) msg*/msg.c_str(); } // GetExtendedDBErrorMsg