bcrypt/tests: Fix incorrect null termination.
Huw Davies
huw at codeweavers.com
Tue Jan 26 03:30:02 CST 2016
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
dlls/bcrypt/tests/bcrypt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index edf478c..5435d4b 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -68,15 +68,15 @@ static void test_BCryptGetFipsAlgorithmMode(void)
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;
+ buf[0] = '\0';
for (i = 0; i < size; i++)
{
- buf += sprintf(buf, "%02x", bytes[i]);
+ sprintf(buf + i * 2, "%02x", bytes[i]);
}
- buf[i * 2] = 0;
- return buf;
+ return;
}
static void test_sha1(void)
--
2.7.0
More information about the wine-patches
mailing list