[PATCH] msvcrt/tests: Avoid an unneeded strlen() call.

Francois Gouget fgouget at free.fr
Tue Dec 10 02:28:43 CST 2019


Note that buf is an array and thus cannot be NULL.

Signed-off-by: Francois Gouget <fgouget at free.fr>
---

I used the buf[0] == 0 form to match the buf[0] == 'X' test a few lines 
up. I'm fine with replacing it with a !*buf too.

 dlls/msvcrt/tests/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/msvcrt/tests/misc.c b/dlls/msvcrt/tests/misc.c
index c59464f82d6..7e2a7e40690 100644
--- a/dlls/msvcrt/tests/misc.c
+++ b/dlls/msvcrt/tests/misc.c
@@ -211,7 +211,7 @@ static void test_strerror_s(void)
     memset(buf, 'X', sizeof(buf));
     ret = pstrerror_s(buf, 1, 0);
     ok(ret == 0, "Expected strerror_s to return 0, got %d\n", ret);
-    ok(strlen(buf) == 0, "Expected output buffer to be null terminated\n");
+    ok(buf[0] == 0, "Expected output buffer to be null terminated\n");
 
     memset(buf, 'X', sizeof(buf));
     ret = pstrerror_s(buf, 2, 0);
-- 
2.20.1




More information about the wine-devel mailing list