Skip to content
Permalink
Browse files

fixup! mingw: use Unicode functions explicitly

Let's pass the character count to `swprintf()`, not the byte count
(which could possibly cause overflows).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed May 22, 2019
1 parent 97d9140 commit 046e6ffe7ce7623df3591d13a81996b9ebf6b9cc
Showing with 1 addition and 1 deletion.
  1. +1 −1 compat/winansi.c
@@ -628,7 +628,7 @@ void winansi_init(void)
}

/* create a named pipe to communicate with the console thread */
if (swprintf(name, sizeof(name) - 1, L"\\\\.\\pipe\\winansi%lu",
if (swprintf(name, ARRAY_SIZE(name) - 1, L"\\\\.\\pipe\\winansi%lu",
GetCurrentProcessId()) < 0)
die("Could not initialize winansi pipe name");
hwrite = CreateNamedPipeW(name, PIPE_ACCESS_OUTBOUND,

0 comments on commit 046e6ff

Please sign in to comment.
You can’t perform that action at this time.