summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-26 11:28:57 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-30 11:23:41 +0200
commit362a21d3a129b90149f6ef645c127f5e86e0ba61 (patch)
tree8583cb29b33de56e4489cb8950d2714a1fb2957e /hwpfilter
parent81ce629c9e8a4fc26ded9d49157e3f3263991e03 (diff)
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 <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpreader.cxx4
-rw-r--r--hwpfilter/source/mzstring.cxx6
2 files changed, 5 insertions, 5 deletions
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 <string.h>
#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;
}