From 8c7daebae902fc3b8fcd16113a89ea8d90d913f9 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 18 Feb 2009 16:51:10 -0600 Subject: [7296] Fixed some GCC warnings. Author: VladimirMangos --HG-- branch : trunk --- src/shared/Util.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/shared/Util.cpp') diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp index 36c41e5da48..767b65e441c 100644 --- a/src/shared/Util.cpp +++ b/src/shared/Util.cpp @@ -254,8 +254,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize) size_t len = utf8::distance(utf8str,utf8str+csize); if(len > wsize) { + if(wsize > 0) + wstr[0] = L'\0'; wsize = 0; - wstr = L""; return false; } @@ -265,8 +266,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize) } catch(std::exception) { + if(wsize > 0) + wstr[0] = L'\0'; wsize = 0; - wstr = L""; return false; } -- cgit v1.2.3