From 8cbccd325bd26f4fd2674e1132f1aa4202efe367 Mon Sep 17 00:00:00 2001 From: anders_k Date: Tue, 24 Oct 2017 21:23:46 +0000 Subject: [PATCH] Handle newline when parsing /version git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6941 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Contrib/Makensisw/utils.cpp b/Contrib/Makensisw/utils.cpp index e4a13574..a350d24f 100644 --- a/Contrib/Makensisw/utils.cpp +++ b/Contrib/Makensisw/utils.cpp @@ -595,6 +595,7 @@ int InitBranding() { } szBuf[dwRead] = 0, ppi = π int len = lstrlenA(szBuf); + while(len && ((szBuf[len - 1] == '\n')|(szBuf[len - 1] == '\r'))) szBuf[--len] = '\0'; if (!len) retval = 0; g_sdata.branding = (TCHAR*) MemAlloc((len+6)*sizeof(TCHAR)); // LEAKED wsprintf(g_sdata.branding, _T("NSIS %hs"), szBuf);