Huw Davies : bcrypt/tests: Fix incorrect null termination.
Module: wine Branch: master Commit: b2e902b84063ba1aa0c6cad3079a438097b596fd URL: http://source.winehq.org/git/wine.git/?a=commit;h=b2e902b84063ba1aa0c6cad307... Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jan 26 09:30:02 2016 +0000 bcrypt/tests: Fix incorrect null termination. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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)
participants (1)
-
Alexandre Julliard