Commit 1a079f3e authored by Thorsten Winkler's avatar Thorsten Winkler Committed by Paolo Abeni

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: default avatarJules Irenge <jbi.octave@gmail.com>
Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarThorsten Winkler <twinkler@linux.ibm.com>
Signed-off-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d3f0c7fa
...@@ -21,7 +21,7 @@ do { \ ...@@ -21,7 +21,7 @@ do { \
#define LCS_DBF_TEXT_(level,name,text...) \ #define LCS_DBF_TEXT_(level,name,text...) \
do { \ do { \
if (debug_level_enabled(lcs_dbf_##name, level)) { \ 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); \ debug_text_event(lcs_dbf_##name, level, debug_buffer); \
} \ } \
} while (0) } while (0)
......
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