]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Fix -Werror=array-bounds failure
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 20 Mar 2023 15:19:36 +0000 (16:19 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 20 Mar 2023 15:21:35 +0000 (16:21 +0100)
tests/control-flow/pre-post-increment-array-index.c-expected
tests/control-flow/pre-post-increment-array-index.vala

index da5169eee613c7f2a9b659ea5852c0baab52cb2b..f10350740a66c31def7cac16d7669e1fe09c5c49 100644 (file)
@@ -18,7 +18,7 @@ _vala_main (void)
        gint _tmp0_;
        gint _tmp1_;
        gint _tmp2_;
-       foo[4] = '\0';
+       foo[3] = '\0';
        i = 0;
        _tmp0_ = i;
        i = _tmp0_ + 1;
index c8a08feca8de344c3eed02a0e4553bb30641d9a0..516028c3d4b9eb0b735626deabca9ff13781287a 100644 (file)
@@ -1,6 +1,6 @@
 void main () {
        char foo[4];
-       foo[4] = '\0';
+       foo[3] = '\0';
 
        var i = 0;
        foo[i++] = 'b';