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/?a=commitdiff_plain;ds=sidebyside;h=445df694a1cf44177c4e9571068a51d8025a551d;hp=7d481cb7bb4a37865e66c110b87476e8df04e690;p=pdclib 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