{
char *psz_charset;
+ if( locale == NULL )
+ return NULL;
+
if( !vlc_current_charset( &psz_charset ) )
{
char *iptr = (ICONV_CONST char *)locale, *output, *optr;
{
char *psz_charset;
+ if( utf8 == NULL )
+ return NULL;
+
if( !vlc_current_charset( &psz_charset ) )
{
char *iptr = (ICONV_CONST char *)utf8, *output, *optr;
void LocaleFree( const char *str )
{
- /* FIXME: this deserve a price for the most inefficient peice of code */
- char *psz_charset;
-
- if( !vlc_current_charset( &psz_charset ) )
- free( (char *)str );
-
- free( psz_charset );
+ if( str != NULL )
+ {
+ /* FIXME: this deserve a price for the most inefficient peice of code */
+ char *psz_charset;
+
+ if( !vlc_current_charset( &psz_charset ) )
+ free( (char *)str );
+
+ free( psz_charset );
+ }
}
/* FIXME: don't use iconv at all */
vlc_iconv_t hd;
size_t inb, outb;
char *ostr, *istr;
-
+
+ if( str == NULL )
+ return NULL;
+
ostr = istr = str;
inb = outb = strlen( str );