Skip to content

Commit fe422aa

Browse files
committed
Use unicode functions on windows
1 parent bc56d08 commit fe422aa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

librz/util/sdb/src/disk.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ RZ_API bool sdb_disk_create(Sdb *s) {
4343
if (s->fdump != -1) {
4444
close(s->fdump);
4545
}
46-
#if __WINDOWS__ && UNICODE
46+
#if __WINDOWS__
4747
wchar_t *wstr = rz_utf8_to_utf16(str);
4848
if (wstr) {
4949
s->fdump = _wopen(wstr, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, SDB_MODE);
@@ -91,11 +91,11 @@ RZ_API bool sdb_disk_finish(Sdb *s) {
9191
reopen = true;
9292
}
9393
#if __WINDOWS__
94-
LPTSTR ndump_ = rz_utf8_to_utf16(s->ndump);
95-
LPTSTR dir_ = rz_utf8_to_utf16(s->dir);
94+
wchar_t *ndump_ = rz_utf8_to_utf16(s->ndump);
95+
wchar_t *dir_ = rz_utf8_to_utf16(s->dir);
9696

97-
if (MoveFileEx(ndump_, dir_, MOVEFILE_REPLACE_EXISTING)) {
98-
// eprintf ("Error 0x%02x\n", GetLastError ());
97+
if (!MoveFileExW(ndump_, dir_, MOVEFILE_REPLACE_EXISTING)) {
98+
eprintf ("Error 0x%02x\n", GetLastError ());
9999
}
100100
free(ndump_);
101101
free(dir_);

0 commit comments

Comments
 (0)