projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f5cb3ee
)
ASoC: SOF: sof-client-probes: Replace snprintf() with scnprintf()
author
HariKrishna Sagala
<hariconscious@gmail.com>
Tue, 11 Nov 2025 05:29:21 +0000
(10:59 +0530)
committer
Mark Brown
<broonie@kernel.org>
Tue, 18 Nov 2025 18:54:14 +0000
(18:54 +0000)
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>
sound/soc/sof/sof-client-probes-ipc4.c
patch
|
blob
|
history
diff --git
a/sound/soc/sof/sof-client-probes-ipc4.c
b/sound/soc/sof/sof-client-probes-ipc4.c
index
758a56d
..
d3fa371
100644
(file)
--- a/
sound/soc/sof/sof-client-probes-ipc4.c
+++ b/
sound/soc/sof/sof-client-probes-ipc4.c
@@
-289,7
+289,7
@@
static int ipc4_probes_point_print(struct sof_client_dev *cdev, char *buf, size_
__func__, SOF_IPC4_MOD_ID_GET(desc->buffer_id),
SOF_IPC4_MOD_INSTANCE_GET(desc->buffer_id));
- ret = snprintf(buf, size, "%#x,%#x,%#x\t%s %s buf idx %lu %s\n",
+ ret = s
c
nprintf(buf, size, "%#x,%#x,%#x\t%s %s buf idx %lu %s\n",
desc->buffer_id, desc->purpose, desc->stream_tag,
swidget ? swidget->widget->name : "<unknown>",
sof_probe_ipc4_type_string(SOF_IPC4_PROBE_TYPE_GET(desc->buffer_id)),