]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
Use %s even if all strings are currently free of percent characters
[vlc] / src / libvlc.c
index 842aa7270b95c376e8dec51088184c9f8476348d..8c1f90717897ee8922d003fb1a4c18ddb5646539 100644 (file)
 static libvlc_int_t *    p_static_vlc = NULL;
 static unsigned          i_instances = 0;
 
+#ifndef WIN32
 static bool b_daemon = false;
+#endif
 
 /*****************************************************************************
  * vlc_gc_*.
@@ -225,7 +227,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
 #endif
 
     /* Announce who we are - Do it only for first instance ? */
-    msg_Dbg( p_libvlc, COPYRIGHT_MESSAGE );
+    msg_Dbg( p_libvlc, "%s", COPYRIGHT_MESSAGE );
     msg_Dbg( p_libvlc, "libvlc was configured with %s", CONFIGURE_LINE );
 
     /* Initialize mutexes */
@@ -907,8 +909,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         if( psz_codecs )
         {
             char *psz_morecodecs;
-            asprintf(&psz_morecodecs, "%s,dmo,quicktime", psz_codecs);
-            if( psz_morecodecs )
+            if( asprintf(&psz_morecodecs, "%s,dmo,quicktime", psz_codecs) != -1 )
             {
                 config_PutPsz( p_libvlc, "codec", psz_morecodecs);
                 free( psz_morecodecs );
@@ -1206,7 +1207,10 @@ static void SetLanguage ( const char *psz_lang )
      * the language at runtime under eg. Windows. Beware that this
      * makes the environment unconsistent when libvlc is unloaded and
      * should probably be moved to a safer place like vlc.c. */
-    setenv( "LC_ALL", psz_lang, 1 );
+    static char psz_lcall[20];
+    snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
+    psz_lcall[19] = '\0';
+    putenv( psz_lcall );
 #endif
 
     setlocale( LC_ALL, psz_lang );