Resolve conflicts.
This commit is contained in:
parent
ddccfc1d45
commit
3951d17b6c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173935
@ -120,13 +120,16 @@ cvt_length(len, ops)
|
|||||||
int len;
|
int len;
|
||||||
int ops;
|
int ops;
|
||||||
{
|
{
|
||||||
if (utf_mode && (ops & CVT_TO_LC))
|
if (utf_mode)
|
||||||
/*
|
/*
|
||||||
* Converting case can cause a UTF-8 string to increase in length.
|
* Just copying a string in UTF-8 mode can cause it to grow
|
||||||
* Multiplying by 3 is the worst case.
|
* in length.
|
||||||
|
* Six output bytes for one input byte is the worst case
|
||||||
|
* (and unfortunately is far more than is needed in any
|
||||||
|
* non-pathological situation, so this is very wasteful).
|
||||||
*/
|
*/
|
||||||
len *= 3;
|
len *= 6;
|
||||||
return len+1;
|
return len + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user