X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fuchar%2Fc16rtomb.c;h=ac8c6295cab69bc474549c1c54eb313caedba826;hp=6e3a27cfd5add2eef9dfe50d11a855b8fe43433e;hb=32967d59c57ca69410f1f69c298d79af53f9ae97;hpb=4cd3da2019b53aa122b4fea4b43b6b311150dbdf diff --git a/functions/uchar/c16rtomb.c b/functions/uchar/c16rtomb.c index 6e3a27c..ac8c629 100644 --- a/functions/uchar/c16rtomb.c +++ b/functions/uchar/c16rtomb.c @@ -24,6 +24,8 @@ size_t c16rtomb_l( ) { const char16_t *restrict psrc = &c16; + char buf[s ? 0 : MB_CUR_MAX]; + s = s ? s : buf; if(!l->_Codec->__c16stombs) { // Codec doesn't support direct conversion - translate via UCS-4