зеркало из https://github.com/github/ruby.git
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:
Родитель
79c50a77ff
Коммит
6d8574ade1
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче