From 79f3a8bee6d69323ee7c6c334856e1de9f4aefc4 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 11 Jul 2021 19:30:26 +1000 Subject: Avoid some incorrect compiler warnings for out-of-bounds access by providing extra bytes. --- test/unit/testUniConversion.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/unit/testUniConversion.cxx b/test/unit/testUniConversion.cxx index 2ee05103e..5e0225568 100644 --- a/test/unit/testUniConversion.cxx +++ b/test/unit/testUniConversion.cxx @@ -84,17 +84,17 @@ TEST_CASE("UniConversion") { // UnicodeFromUTF8 SECTION("UnicodeFromUTF8 ASCII") { - const unsigned char s[]={'a', 0}; + const unsigned char s[]={'a', 0, 0, 0}; REQUIRE(UnicodeFromUTF8(s) == 'a'); } SECTION("UnicodeFromUTF8 Example1") { - const unsigned char s[]={0x24, 0}; + const unsigned char s[]={0x24, 0, 0, 0}; REQUIRE(UnicodeFromUTF8(s) == 0x24); } SECTION("UnicodeFromUTF8 Example2") { - const unsigned char s[]={0xC2, 0xA2, 0}; + const unsigned char s[]={0xC2, 0xA2, 0, 0}; REQUIRE(UnicodeFromUTF8(s) == 0xA2); } -- cgit v1.2.3