Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: sof-client-probes: Replace snprintf() with scnprintf()

As per the C99 standard snprintf() returns the length of the data
that *would have been* written if there were enough space for it.
It's generally considered safer to use the scnprintf() variant.

Link: https://github.com/KSPP/linux/issues/105
Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
Link: https://patch.msgid.link/20251111052920.56459-2-hariconscious@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

HariKrishna Sagala and committed by
Mark Brown
e4597964 f5cb3ee2

+1 -1
+1 -1
sound/soc/sof/sof-client-probes-ipc4.c
··· 289 289 __func__, SOF_IPC4_MOD_ID_GET(desc->buffer_id), 290 290 SOF_IPC4_MOD_INSTANCE_GET(desc->buffer_id)); 291 291 292 - ret = snprintf(buf, size, "%#x,%#x,%#x\t%s %s buf idx %lu %s\n", 292 + ret = scnprintf(buf, size, "%#x,%#x,%#x\t%s %s buf idx %lu %s\n", 293 293 desc->buffer_id, desc->purpose, desc->stream_tag, 294 294 swidget ? swidget->widget->name : "<unknown>", 295 295 sof_probe_ipc4_type_string(SOF_IPC4_PROBE_TYPE_GET(desc->buffer_id)),