Commit a54335c7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

snprintf() always puts a nul terminator...

...unless the buffer has zero size.
This is not to be confused with strncpy().
parent 88e7248c
...@@ -1177,8 +1177,7 @@ static void SetLanguage ( const char *psz_lang ) ...@@ -1177,8 +1177,7 @@ static void SetLanguage ( const char *psz_lang )
* makes the environment unconsistent when libvlc is unloaded and * makes the environment unconsistent when libvlc is unloaded and
* should probably be moved to a safer place like vlc.c. */ * should probably be moved to a safer place like vlc.c. */
static char psz_lcall[20]; static char psz_lcall[20];
snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang ); snprintf( psz_lcall, sizeof(psz_lcall), "LC_ALL=%s", psz_lang );
psz_lcall[19] = '\0';
putenv( psz_lcall ); putenv( psz_lcall );
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment