vol: Fix format-truncation warning with gcc-10.1 07/14207/2
authorCheyenne Wills <cwills@sinenomine.net>
Mon, 11 May 2020 20:06:19 +0000 (14:06 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 22 May 2020 16:11:56 +0000 (12:11 -0400)
commitd73680c5f70ee5aeb634a9ec88bf1097743d0f76
tree12a2924cf7396321ab57d62b6a01dee97a84a334
parentc81579dc7b0c0ac6bc34f63384d705a4445c2bbd
vol: Fix format-truncation warning with gcc-10.1

Building with gcc-10.1 produces a warning (error if --enable-checking)
in vol-salvage.c

error: ā€˜%sā€™ directive output may be truncated writing up to 755 bytes
       into a region of size 255 [-Werror=format-truncation=]
  809 |     snprintf(inodeListPath, 255, "%s" OS_DIRSEP "salvage.inodes.%s.%d", tdir, name,

Use strdup/asprintf to allocate the buffer dynamically instead of using
a buffer with a hardcoded size.

Change-Id: Ib2f01c2eb73c7abc162be2b1939e55688a81f812
Reviewed-on: https://gerrit.openafs.org/14207
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/vol/vol-salvage.c