From 42fe2b8d4369f65ab5ff4c59941763c29ec94ac7 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 25 Jan 2007 14:07:29 +0000 Subject: [PATCH] fixed winchar_strcmp git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4893 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/winchar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/winchar.cpp b/Source/winchar.cpp index cb9a568a..8c9c8231 100644 --- a/Source/winchar.cpp +++ b/Source/winchar.cpp @@ -80,15 +80,15 @@ size_t winchar_strlen(WCHAR *ws) int winchar_strcmp(const WCHAR *ws1, const WCHAR *ws2) { - WCHAR diff = 0; + int diff = 0; do { - diff = *ws1 - *ws2; + diff = static_cast(*ws1) - static_cast(*ws2); } - while (*ws1++ && *ws2++); + while (*ws1++ && *ws2++ && !diff); - return static_cast(diff); + return diff; } int winchar_stoi(const WCHAR *ws)