Whamcloud - gitweb
LU-12861 libcfs: Cleanup libcfs_debug_msg use of snprintf 01/36901/8
authorShaun Tancheff <shaun.tancheff@hpe.com>
Fri, 31 Jan 2020 20:09:34 +0000 (14:09 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:51:21 +0000 (05:51 +0000)
commit4ec32fe7c92dce7f6699d36cebac19d8d1abf9e0
treee87e03e929f93f885640267d95fefbc21273cab8
parent45d71469226485c7bb348ffcb1700667c1fb2fa2
LU-12861 libcfs: Cleanup libcfs_debug_msg use of snprintf

scnprintf returns the number of bytes written to the buffer.
snprintf returns the size of the buffer needed to satisfy
the request.

Prefer scnprintf when result is being used as the number
of bytes in a buffer.

Use snprintf when the result is used for sizing or resizing
a buffer.

Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I8c4b8f7dcc081f8b9dfffc35059011172be2e091
Reviewed-on: https://review.whamcloud.com/36901
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Ben Evans <beevans@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/tracefile.c