]> pd.if.org Git - pdclib/commitdiff
PDCLIB-2 c16rtomb: did not support NULL destination buffer mode (count output characters)
authorOwen Shepherd <owen.shepherd@e43.eu>
Tue, 23 Apr 2013 17:57:47 +0000 (18:57 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Tue, 23 Apr 2013 17:57:47 +0000 (18:57 +0100)
functions/uchar/c16rtomb.c

index 6e3a27cfd5add2eef9dfe50d11a855b8fe43433e..ac8c6295cab69bc474549c1c54eb313caedba826 100644 (file)
@@ -24,6 +24,8 @@ size_t c16rtomb_l(
 )\r
 {\r
     const char16_t *restrict psrc = &c16;\r
 )\r
 {\r
     const char16_t *restrict psrc = &c16;\r
+    char buf[s ? 0 : MB_CUR_MAX];\r
+    s =      s ? s : buf;\r
 \r
     if(!l->_Codec->__c16stombs) {\r
         // Codec doesn't support direct conversion - translate via UCS-4\r
 \r
     if(!l->_Codec->__c16stombs) {\r
         // Codec doesn't support direct conversion - translate via UCS-4\r