aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-07-11 19:30:26 +1000
committerNeil <nyamatongwe@gmail.com>2021-07-11 19:30:26 +1000
commit79f3a8bee6d69323ee7c6c334856e1de9f4aefc4 (patch)
tree8c8d317c827524eb9c67b9ebd02b8dac91cb6d85
parent4ab2ff79d6308a78b78a63105b55eee2e2aad120 (diff)
downloadscintilla-mirror-79f3a8bee6d69323ee7c6c334856e1de9f4aefc4.tar.gz
Avoid some incorrect compiler warnings for out-of-bounds access by providing
extra bytes.
-rw-r--r--test/unit/testUniConversion.cxx6
1 files changed, 3 insertions, 3 deletions
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);
}