common/test: fix -O3 compile error with gcc-12 (Ubuntu 12.3.0-17ubuntu1) 12.3.0

```
common/test/run-splice_script.c: In function ‘main’:
common/test/run-splice_script.c:349:17: error: ‘%.*s’ directive argument is null [-Werror=format-overflow=]
  349 |         printf("%.*s\n", (int)len, str);
      |                 ^~~~
cc1: all warnings being treated as errors
make: *** [Makefile:297: common/test/run-splice_script.o] Error 1
make: *** Waiting for unfinished jobs....
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-11-22 14:02:34 +10:30
parent 8566370087
commit 9295b4f77e

View file

@ -345,10 +345,8 @@ int main(int argc, char *argv[])
splice_to_json(tmpctx, result, js);
str = json_out_contents(js->jout, &len);
printf("%.*s\n", (int)len, str);
assert(str);
printf("%.*s\n", (int)len, str);
toks = json_parse_simple(tmpctx, str, len);