diff options
| author | dearblue <[email protected]> | 2019-08-18 15:46:17 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2019-08-18 15:46:17 +0900 |
| commit | 74395d7577d6dc3bde50b90aba738df5f716f9e2 (patch) | |
| tree | 5f1731ca2fc01bcb93e1dfd275aadc773025d75e | |
| parent | 83dab1ee0d0d3aa76e44f7fbf14360ee501be151 (diff) | |
| download | mruby-74395d7577d6dc3bde50b90aba738df5f716f9e2.tar.gz mruby-74395d7577d6dc3bde50b90aba738df5f716f9e2.zip | |
Suppress warnings for `strncat()`
`strncat()` also needs `'\0'`.
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 3a55c8e70..d26a29a27 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -5020,10 +5020,10 @@ parser_yylex(parser_state *p) } if (c2) { char buf[256]; - char cc = (char)c2; + char cc[] = { (char)c2, '\0' }; strcpy(buf, "invalid character syntax; use ?\\"); - strncat(buf, &cc, 1); + strncat(buf, cc, 2); yyerror(p, buf); } } |
