From 32967d59c57ca69410f1f69c298d79af53f9ae97 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Tue, 23 Apr 2013 18:57:47 +0100 Subject: [PATCH] PDCLIB-2 c16rtomb: did not support NULL destination buffer mode (count output characters) --- functions/uchar/c16rtomb.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.40.0