]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
snprintf() always puts a nul terminator...
[vlc] / src / libvlc.c
index b5c87332e7b2a606563a28e28615942c1761b628..b11f40fc1ef69ddb86bcd93c275bc0f8468864d6 100644 (file)
@@ -1177,8 +1177,7 @@ static void SetLanguage ( const char *psz_lang )
      * makes the environment unconsistent when libvlc is unloaded and
      * should probably be moved to a safer place like vlc.c. */
     static char psz_lcall[20];
-    snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
-    psz_lcall[19] = '\0';
+    snprintf( psz_lcall, sizeof(psz_lcall), "LC_ALL=%s", psz_lang );
     putenv( psz_lcall );
 #endif