[MSTSC] Fix parsing of settings. Patch by Stas'M. Thanks. CORE-13223
authorPeter Hater <7element@mail.bg>
Wed, 17 May 2017 10:53:54 +0000 (10:53 +0000)
committerPeter Hater <7element@mail.bg>
Wed, 17 May 2017 10:53:54 +0000 (10:53 +0000)
svn path=/trunk/; revision=74568

reactos/base/applications/mstsc/settings.c

index 4aaa2aa..6a68282 100644 (file)
@@ -275,7 +275,10 @@ ParseSettings(PRDPSETTINGS pRdpSettings,
                 else if (lpToken[0] == L's')
                 {
                     pRdpSettings->pSettings[i].Type = lpToken[0];
-                    lpToken = wcstok(NULL, szNewline);
+                    if (lpToken[2] == 13 || lpToken[2] == 10 || lpToken[2] == 0)
+                        lpToken[0] = 0; // terminate string
+                    else
+                        lpToken = wcstok(NULL, szNewline);
                     if (lpToken != NULL)
                         wcscpy(pRdpSettings->pSettings[i].Value.s, lpToken);
                 }