mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Make C_ (gettext used in completions) return wcstring
This commit is contained in:
@@ -255,7 +255,6 @@ char *wcs2str(const wchar_t *in)
|
||||
{
|
||||
if (! in)
|
||||
return NULL;
|
||||
char *out;
|
||||
size_t desired_size = MAX_UTF8_BYTES*wcslen(in)+1;
|
||||
char local_buff[512];
|
||||
if (desired_size <= sizeof local_buff / sizeof *local_buff)
|
||||
@@ -277,7 +276,7 @@ char *wcs2str(const wchar_t *in)
|
||||
else
|
||||
{
|
||||
// here we fall into the bad case of allocating a buffer probably much larger than necessary
|
||||
out = (char *)malloc(MAX_UTF8_BYTES*wcslen(in)+1);
|
||||
char *out = (char *)malloc(MAX_UTF8_BYTES*wcslen(in)+1);
|
||||
if (!out)
|
||||
{
|
||||
DIE_MEM();
|
||||
|
||||
Reference in New Issue
Block a user