File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -281,16 +281,16 @@ static char *_path_field (const char *path);
281281
282282// Converts to UTF-8
283283#ifdef HAVE_NATIVE_WCHAR2
284- # define VALUE_TEXT_TU (wstr ) \
285- if (wstr) \
286- { \
287- wchar_t *_buf = malloc (6 * wcslen ((wchar_t *)wstr) + 2); \
288- fprintf (dat->fh, "\"%ls\"", wcquote (_buf, (wchar_t *)wstr)); \
289- free (_buf); \
290- } \
291- else \
292- { \
293- fprintf (dat->fh, "\"%ls\"", wstr ? (wchar_t *)wstr : L""); \
284+ # define VALUE_TEXT_TU (wstr ) \
285+ if (wstr) \
286+ { \
287+ wchar_t *_buf = malloc (( 6 * wcslen ((wchar_t *)wstr) + 1) * sizeof(wchar_t)); \
288+ fprintf (dat->fh, "\"%ls\"", wcquote (_buf, (wchar_t *)wstr)); \
289+ free (_buf); \
290+ } \
291+ else \
292+ { \
293+ fprintf (dat->fh, "\"%ls\"", wstr ? (wchar_t *)wstr : L""); \
294294 }
295295#else
296296# define VALUE_TEXT_TU (wstr ) print_wcquote (dat, (BITCODE_TU)wstr)
You can’t perform that action at this time.
0 commit comments