setupapi: Properly null-terminate the path in concat_W().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-05-01 18:24:11 -05:00 committed by Alexandre Julliard
parent e8c4dbcec2
commit db8e2388d9
1 changed files with 2 additions and 0 deletions

View File

@ -122,6 +122,7 @@ static void concat_W( WCHAR *buffer, const WCHAR *src1, const WCHAR *src2, const
strcpyW( buffer, src1 ); strcpyW( buffer, src1 );
buffer += strlenW(buffer ); buffer += strlenW(buffer );
if (buffer[-1] != '\\') *buffer++ = '\\'; if (buffer[-1] != '\\') *buffer++ = '\\';
*buffer = 0;
if (src2) while (*src2 == '\\') src2++; if (src2) while (*src2 == '\\') src2++;
} }
@ -130,6 +131,7 @@ static void concat_W( WCHAR *buffer, const WCHAR *src1, const WCHAR *src2, const
strcpyW( buffer, src2 ); strcpyW( buffer, src2 );
buffer += strlenW(buffer ); buffer += strlenW(buffer );
if (buffer[-1] != '\\') *buffer++ = '\\'; if (buffer[-1] != '\\') *buffer++ = '\\';
*buffer = 0;
if (src3) while (*src3 == '\\') src3++; if (src3) while (*src3 == '\\') src3++;
} }