X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Flibvlc.c;h=0fdfc303703e25d7e436349ca8569bdacc239bba;hb=fcf05b24781d8a02b0172951d8b3b5b94bdefa38;hp=ff6123336d1a25282a4da718c44a6e86656959c6;hpb=a82dc303ae8655384fdfb4b67643536355c4b604;p=vlc diff --git a/src/libvlc.c b/src/libvlc.c index ff6123336d..0fdfc30370 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -43,7 +43,6 @@ #include "modules/modules.h" #include "config/configuration.h" -#include /* ENOMEM */ #include /* sprintf() */ #include #include /* free() */ @@ -770,7 +769,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, PRINT_CAPABILITY( CPU_CAPABILITY_SSE, "SSE" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE2, "SSE2" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE3, "SSE3" ); - PRINT_CAPABILITY( CPU_CAPABILITY_SSE3, "SSSE3" ); + PRINT_CAPABILITY( CPU_CAPABILITY_SSSE3, "SSSE3" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE4_1, "SSE4.1" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE4_2, "SSE4.2" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE4A, "SSE4A" ); @@ -858,7 +857,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, */ /* Create volume callback system. (this variable must be created before all interfaces as they can use it) */ - var_Create( p_libvlc, "volume-change", VLC_VAR_BOOL ); + var_Create( p_libvlc, "volume-change", VLC_VAR_VOID ); var_Create( p_libvlc, "volume-muted", VLC_VAR_BOOL ); psz_modules = var_CreateGetNonEmptyString( p_libvlc, "extraintf" ); @@ -1225,11 +1224,16 @@ static inline int LoadMessages (void) static const char psz_path[] = LOCALEDIR; #else char psz_path[1024]; - if (snprintf (psz_path, sizeof (psz_path), "%s" DIR_SEP "%s", - config_GetDataDirDefault(), "locale") - >= (int)sizeof (psz_path)) - return -1; + char *datadir = config_GetDataDirDefault(); + int ret; + if (unlikely(datadir == NULL)) + return -1; + ret = snprintf (psz_path, sizeof (psz_path), "%s" DIR_SEP "locale", + datadir); + free (datadir); + if (ret >= (int)sizeof (psz_path)) + return -1; #endif if (bindtextdomain (PACKAGE_NAME, psz_path) == NULL) {