Changeset 62


Ignore:
Timestamp:
10/15/2007 11:20:52 AM (7 years ago)
Author:
lowjoel
Message:

Fixed a buffer overrun error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Launcher/Launcher.cpp

    r61 r62  
    289289///////////////////////////////////////////////////////////////////////////// 
    290290// CLauncherApp initialization 
    291 void ShowHelp(const CString& message = "") 
    292 { 
    293     CString msg; 
    294     msg.LoadString(AfxGetInstanceHandle(), IDS_CMDLINE_INCORRECT); 
    295     AfxMessageBox(message + msg, MB_ICONERROR, 0); 
    296 } 
    297  
    298291BOOL CLauncherApp::InitInstance() 
    299292{ 
     
    346339            { 
    347340                CString msg = Message; 
    348                 chrBuf = new char[msg.GetLength()]; 
     341                chrBuf = new char[msg.GetLength() + 1]; 
    349342                strcpy(chrBuf, msg.GetBuffer()); 
    350343                msg.ReleaseBuffer(); 
     
    606599    catch (InvalidCommandLineException& e) 
    607600    { 
    608         ShowHelp(CString(e.what()) + "\n\n"); 
     601        CString msg; 
     602        msg.LoadString(AfxGetInstanceHandle(), IDS_CMDLINE_INCORRECT); 
     603        AfxMessageBox(CString(e.what()) + "\n\n" + msg, MB_ICONERROR); 
    609604    } 
    610605    catch (CException *e) 
Note: See TracChangeset for help on using the changeset viewer.