X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fuchar%2Fc32rtomb.c;h=19f65f1094b37a2f2a942d9291ddb70012f04000;hp=b72b7e9e8bcf6199c144640ba59f3bcb3d18dd09;hb=da0f3f353d417fed71f358a48d5d5394145e460d;hpb=58ad73359fcce5653230a918af494a46ac796886 diff --git a/functions/uchar/c32rtomb.c b/functions/uchar/c32rtomb.c index b72b7e9..19f65f1 100644 --- a/functions/uchar/c32rtomb.c +++ b/functions/uchar/c32rtomb.c @@ -1,7 +1,4 @@ -/* c32rtomb( - char *restrict s, - char32_t c32, - mbstate_t *restrict ps); +/* c32rtomb( char *, char32_t, mbstate_t * ) This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. @@ -13,8 +10,8 @@ #include #include #include -#include <_PDCLIB_encoding.h> -#include <_PDCLIB_locale.h> +#include "_PDCLIB_encoding.h" +#include "_PDCLIB_locale.h" size_t c32rtomb_l( char *restrict s, @@ -23,6 +20,9 @@ size_t c32rtomb_l( locale_t restrict l ) { + char buf[s ? 0 : MB_CUR_MAX]; + s = s ? s : buf; + const char32_t *restrict psrc = &c32; size_t srcsz = 1; size_t dstsz = MB_CUR_MAX; @@ -49,7 +49,7 @@ size_t c32rtomb( #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" int main( void ) {