From b9f623a90ab5f8114dddfad2c6bf01744d7236f7 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 8 Nov 2021 16:47:49 -0800 Subject: [PATCH] Fix warning in test code. NFC This is current blocking the llvm roller which started reporting: ``` test_sscanf.c:78:25: error: 'sscanf' may overflow; destination buffer in argument 3 has size 100, but the corresponding specifier may require size 256 [-Werror,-Wfortify-source] ``` --- tests/core/test_sscanf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/test_sscanf.c b/tests/core/test_sscanf.c index aa38be3dcde27..c6c3945a1d5df 100644 --- a/tests/core/test_sscanf.c +++ b/tests/core/test_sscanf.c @@ -74,7 +74,7 @@ int main() { memset(buf4, 0, 100); - int numItems = sscanf("level=4:ref=3", "%255[^:=]=%255[^:]:%255[^=]=%c", + int numItems = sscanf("level=4:ref=3", "%99[^:=]=%99[^:]:%99[^=]=%c", buf1, buf2, buf3, buf4); printf("%d, %s, %s, %s, %s\n", numItems, buf1, buf2, buf3, buf4);