From: Lennart Poettering Date: Thu, 21 Aug 2008 22:11:13 +0000 (+0200) Subject: Add trailing NUL character to snprintf output X-Git-Tag: v1.0.18rc3~19 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=4902e7a9e83d48398cd84b28e00daa837555b83e;p=alsa-plugins.git Add trailing NUL character to snprintf output snprintf doesn't necessarily append a trailing NUL to the strings it writes. So let's do it explicitly. --- diff --git a/pulse/pulse.c b/pulse/pulse.c index 8a60507..8e47b6c 100644 --- a/pulse/pulse.c +++ b/pulse/pulse.c @@ -162,6 +162,7 @@ snd_pulse_t *pulse_new(void) pa_path_get_filename(proc)); else snprintf(buf, sizeof(buf), "ALSA plug-in"); + buf[sizeof(buf)-1] = 0; p->context = pa_context_new(pa_threaded_mainloop_get_api(p->mainloop), buf);