]> git.sesse.net Git - vlc/commitdiff
Fix (From|To)Locale (closes #546)
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 13 Feb 2006 13:16:08 +0000 (13:16 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 13 Feb 2006 13:16:08 +0000 (13:16 +0000)
configure.ac
src/misc/unicode.c

index 61d3003f56a981eab07b44e9ecb169ce6eda839e..05de657a77098da99e905d46a4826f7c976871d0 100644 (file)
@@ -382,7 +382,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
 dnl Check for system libs needed
 need_libc=false
 
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat assert)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat)
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS(strdup strndup atof)
index 4b4714a8391fc1a0d828dbf452b89ed483e5602a..c58c54cc9a365a2d5ff4b07214d4bfb6a172b667 100644 (file)
 #include <vlc/vlc.h>
 #include "charset.h"
 
-#ifdef HAVE_ASSERT
-# include <assert.h>
-#else
-# define assert( c ) ((void)0)
-#endif
+#include <assert.h>
 
 #include <stdio.h>
 #include <errno.h>
@@ -183,6 +179,7 @@ char *FromLocale( const char *locale )
             vlc_iconv( from_locale.hd, NULL, NULL, NULL, NULL );
         }
         vlc_mutex_unlock( &from_locale.lock );
+        *optr = '\0';
 
         assert (inb == 0);
         assert (*iptr == '\0');
@@ -249,6 +246,7 @@ char *ToLocale( const char *utf8 )
             vlc_iconv( to_locale.hd, NULL, NULL, NULL, NULL );
         }
         vlc_mutex_unlock( &to_locale.lock );
+        *optr = '\0';
 
         assert (inb == 0);
         assert (*iptr == '\0');