Whamcloud - gitweb
LU-12861 libcfs: provide an scnprintf and start using it 53/36453/8
authorShaun Tancheff <stancheff@cray.com>
Tue, 29 Oct 2019 22:14:18 +0000 (17:14 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 Dec 2019 03:26:36 +0000 (03:26 +0000)
commit998a494fa9a46b92d4c7fb3485a0faeb78beb2cd
treec5ef2737e503f4db8ae9dc60fdbf0a1aff11f8a8
parente380010b810a67fed68751d13651c979539accb6
LU-12861 libcfs: provide an scnprintf and start using it

snprintf() returns the number of chars that would be needed to hold
the complete result, which may be larger that the buffer size.

scnprintf differs in it's return value is number of chars actually
written (not including the terminating null).

Correct the few patterns where the return from snprintf() is used and
expected not to exceed the passed buffer size.

Test-Parameters: trivial
Cray-bug-id: LUS-7999
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Change-Id: Ie42458be16e8c0ba1cb6d688fd418683f18de21e
Reviewed-on: https://review.whamcloud.com/36453
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
18 files changed:
libcfs/include/libcfs/util/string.h
libcfs/libcfs/util/nidstrings.c
libcfs/libcfs/util/string.c
lnet/lnet/config.c
lnet/lnet/router_proc.c
lnet/utils/lnetconfig/liblnetconfig.c
lustre/lod/lod_dev.c
lustre/lod/lod_object.c
lustre/mgs/mgs_llog.c
lustre/osc/lproc_osc.c
lustre/tests/fsx.c
lustre/utils/debug.c
lustre/utils/gss/cacheio.c
lustre/utils/gss/lgss_utils.c
lustre/utils/gss/sk_utils.c
lustre/utils/lfs.c
lustre/utils/lsnapshot.c
lustre/utils/mount_lustre.c