From: Owen Shepherd Date: Tue, 23 Apr 2013 17:57:47 +0000 (+0100) Subject: PDCLIB-2 c16rtomb: did not support NULL destination buffer mode (count output characters) X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=commitdiff_plain;h=32967d59c57ca69410f1f69c298d79af53f9ae97 PDCLIB-2 c16rtomb: did not support NULL destination buffer mode (count output characters) --- 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