From 362a21d3a129b90149f6ef645c127f5e86e0ba61 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 26 Sep 2017 11:28:57 +0300 Subject: Use explicit function names for fooA/fooW WinAPI; prefer fooW We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- hwpfilter/source/hwpreader.cxx | 4 ++-- hwpfilter/source/mzstring.cxx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'hwpfilter/source') diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 8ac074eff35c..47869520de23 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -532,11 +532,11 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) char dirname[128]; int fd; #ifdef _WIN32 - GetTempPath(sizeof(dirname), dirname); + GetTempPathA(sizeof(dirname), dirname); sprintf(filename, "%s%s",dirname, emp->name); if( (fd = open( filename , _O_CREAT | _O_WRONLY | _O_BINARY , 0666)) >= 0 ) #else - strcpy(dirname, "/tmp/"); + strcpy(dirname, "/tmp/"); sprintf(filename, "%s%s", dirname, emp->name); if( (fd = open( filename , O_CREAT | O_WRONLY , 0666)) >= 0 ) #endif diff --git a/hwpfilter/source/mzstring.cxx b/hwpfilter/source/mzstring.cxx index 6b579e47b8f6..dae04be2169b 100644 --- a/hwpfilter/source/mzstring.cxx +++ b/hwpfilter/source/mzstring.cxx @@ -34,7 +34,7 @@ #include #ifndef _WIN32 -# define wsprintf sprintf +# define wsprintfA sprintf #endif const int AllocSize = 8; @@ -181,7 +181,7 @@ MzString &MzString::operator << (int i) { char str[80]; - wsprintf(str, "%d", i); + wsprintfA(str, "%d", i); append(str); return *this; } @@ -191,7 +191,7 @@ MzString &MzString::operator << (long l) { char str[80]; - wsprintf(str, "%ld", l); + wsprintfA(str, "%ld", l); append(str); return *this; } -- cgit