https://git.reactos.org/?p=reactos.git;a=commitdiff;h=313ded449ce3ecff1c1fb2412a6fbd8732739fc7

commit 313ded449ce3ecff1c1fb2412a6fbd8732739fc7
Author:     Benedikt Freisen <[email protected]>
AuthorDate: Thu May 31 20:17:30 2018 +0200
Commit:     Benedikt Freisen <[email protected]>
CommitDate: Thu May 31 20:17:30 2018 +0200

    [MSPAINT] use __targv[1] instead of lpszArgument
    
    This should make Paint's handling of command line strings less brittle.
    
    CORE-13293
---
 base/applications/mspaint/main.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/applications/mspaint/main.cpp 
b/base/applications/mspaint/main.cpp
index 510688ea98..8b0bfe7bf8 100644
--- a/base/applications/mspaint/main.cpp
+++ b/base/applications/mspaint/main.cpp
@@ -259,15 +259,15 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE 
hPrevInstance, LPTSTR lpszArgument
     RECT imageAreaPos = {3, 3, 3 + imageModel.GetWidth(), 3 + 
imageModel.GetHeight()};
     imageArea.Create(scrlClientWindow.m_hWnd, imageAreaPos, NULL, WS_CHILD | 
WS_VISIBLE);
 
-    if (lpszArgument[0] != 0)
+    if (__argc >= 2)
     {
         HBITMAP bmNew = NULL;
-        LoadDIBFromFile(&bmNew, lpszArgument, &fileTime, &fileSize, &fileHPPM, 
&fileVPPM);
+        LoadDIBFromFile(&bmNew, __targv[1], &fileTime, &fileSize, &fileHPPM, 
&fileVPPM);
         if (bmNew != NULL)
         {
             TCHAR *temp;
             imageModel.Insert(bmNew);
-            GetFullPathName(lpszArgument, SIZEOF(filepathname), filepathname, 
&temp);
+            GetFullPathName(__targv[1], SIZEOF(filepathname), filepathname, 
&temp);
             CPath pathFileName(filepathname);
             pathFileName.StripPath();
             CString strTitle;

Reply via email to