static char *locale_fast (const char *string, bool from)
{
+ if( string == NULL )
+ return NULL;
+
#if defined (USE_ICONV)
if (find_charset ())
return (char *)string;
size_t outb = inb * 6 + 1;
char output[outb], *optr = output;
- if (string == NULL)
- return NULL;
-
while (vlc_iconv (hd, &iptr, &inb, &optr, &outb) == (size_t)(-1))
{
*optr++ = '?';
char *out;
int len;
- if (string == NULL)
- return NULL;
-
len = 1 + MultiByteToWideChar (from ? CP_ACP : CP_UTF8,
0, string, -1, NULL, 0);
wchar_t wide[len];