diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-08-19 07:31:26 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-08-19 07:31:26 +0900 |
| commit | 3fbd5f0029c24d43870a44b342ab9600d7c1fcca (patch) | |
| tree | 3b5d9ad91f2a86e46ec0379d66d29abc35864381 | |
| parent | f263088b0d3fa4c3a495272875802545709c1848 (diff) | |
| parent | 74395d7577d6dc3bde50b90aba738df5f716f9e2 (diff) | |
| download | mruby-3fbd5f0029c24d43870a44b342ab9600d7c1fcca.tar.gz mruby-3fbd5f0029c24d43870a44b342ab9600d7c1fcca.zip | |
Merge pull request #4639 from dearblue/suppress-Wstringop-truncation
Suppress warnings for `strncat()`
| -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); } } |
