summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorThorsten Winkler <twinkler@linux.ibm.com>2023-06-21 15:49:19 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-06-23 11:55:54 +0200
commit1a079f3e95295c3534c89f008e5e961a386e25e9 (patch)
treecc220aaf4e8c5abc1ab420bf36650745bd34b7ef /drivers/s390/net
parentd3f0c7fa09932d34bbf5548a156316927a099f25 (diff)
downloadlinux-1a079f3e95295c3534c89f008e5e961a386e25e9.tar.gz
linux-1a079f3e95295c3534c89f008e5e961a386e25e9.tar.bz2
linux-1a079f3e95295c3534c89f008e5e961a386e25e9.zip
s390/lcs: Convert sprintf to scnprintf
This LWN article explains the why scnprintf is preferred over snprintf in general https://lwn.net/Articles/69419/ Ie. snprintf() returns what *would* be the resulting length, while scnprintf() returns the actual length. Reported-by: Jules Irenge <jbi.octave@gmail.com> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Signed-off-by: Thorsten Winkler <twinkler@linux.ibm.com> Signed-off-by: Alexandra Winter <wintera@linux.ibm.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/lcs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index bd52caa3b11b..a2699b70b050 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -21,7 +21,7 @@ do { \
#define LCS_DBF_TEXT_(level,name,text...) \
do { \
if (debug_level_enabled(lcs_dbf_##name, level)) { \
- sprintf(debug_buffer, text); \
+ scnprintf(debug_buffer, sizeof(debug_buffer), text); \
debug_text_event(lcs_dbf_##name, level, debug_buffer); \
} \
} while (0)