Skip to content

Commit

Permalink
buf is multibyte type. So, FormatMessage should be multibyte Function.
Browse files Browse the repository at this point in the history
Default FormatMessage is binding to wide-char version, FormatMessageW.
  • Loading branch information
drvoss authored and klali committed Nov 13, 2018
1 parent 5d0797f commit 6db0980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ykcore/ykcore_windows.c
Expand Up @@ -199,7 +199,7 @@ int _ykusb_get_vid_pid(void *yk, int *vid, int *pid) {
const char *_ykusb_strerror(void)
{
static char buf[1024];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
buf, sizeof(buf), NULL);
return buf;
}

0 comments on commit 6db0980

Please sign in to comment.