mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
nasmlib/file.c: Win32: add missing filename argument to conversion
In os_mangle_filename() with _WIN32, MultiByteToWideChar() was being
called with five arguments instead of six, missing the actual
string to convert(!)
Fixes: 5dfcfc8cab
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
0dd578ce68
commit
4b37759129
1 changed files with 4 additions and 2 deletions
|
|
@ -54,14 +54,16 @@ static os_filename os_mangle_filename(const char *filename)
|
|||
size_t wclen;
|
||||
wchar_t *buf;
|
||||
|
||||
wclen = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, -1, NULL, 0);
|
||||
wclen = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filename,
|
||||
-1, NULL, 0);
|
||||
if (!wclen)
|
||||
return NULL;
|
||||
|
||||
/* wclen is in "characters" (UTF-16 code points) */
|
||||
buf = nasm_malloc(wclen << 1);
|
||||
|
||||
wclen = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, -1, buf, wclen);
|
||||
wclen = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filename,
|
||||
-1, buf, wclen);
|
||||
if (!wclen) {
|
||||
nasm_free(buf);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue