bcrypt/tests: Fix incorrect null termination.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-01-26 09:30:02 +00:00 committed by Alexandre Julliard
parent ee77e1789c
commit b2e902b840
1 changed files with 4 additions and 4 deletions

View File

@ -68,15 +68,15 @@ static void test_BCryptGetFipsAlgorithmMode(void)
ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got 0x%x\n", ret); ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got 0x%x\n", ret);
} }
static const char *format_hash(const UCHAR *bytes, ULONG size, char *buf) static void format_hash(const UCHAR *bytes, ULONG size, char *buf)
{ {
ULONG i; ULONG i;
buf[0] = '\0';
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
{ {
buf += sprintf(buf, "%02x", bytes[i]); sprintf(buf + i * 2, "%02x", bytes[i]);
} }
buf[i * 2] = 0; return;
return buf;
} }
static void test_sha1(void) static void test_sha1(void)