mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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>
This commit is contained in:
parent
d3f0c7fa09
commit
1a079f3e95
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user