1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

get rid of strcat

* regerror.c (onig_vsnprintf_with_pattern): use memcpy with the
  known length instead of strcat.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-12-26 09:28:47 +00:00
parent 79c50a77ff
commit 6d8574ade1

View file

@ -324,7 +324,8 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
need = (pat_end - pat) * 4 + 4;
if (n + need < (size_t )bufsize) {
xstrcat((char* )buf, ": /", bufsize);
static const char sep[] = ": /";
memcpy((char* )buf + n, sep, sizeof(sep));
s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
p = pat;