Satisfy clang's aggressive strlcpy warnings
authorBenjamin Kaduk <kaduk@mit.edu>
Thu, 6 Feb 2014 20:52:49 +0000 (15:52 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 8 Feb 2014 22:10:44 +0000 (14:10 -0800)
commita52346ae503dc6aedb5115ef6b089ae26f46a58c
treee79cc971d60e4087556868e4026b74efda99ded5
parentadd4b8100e9b9624b6e03fa7d471367720ab062e
Satisfy clang's aggressive strlcpy warnings

Passing something related to the length of the source as the
length argument to strlcpy triggers a warning, which is converted
to an error with --enable-checking (on FreeBSD 10.0).  The current
code is safe, since it is using the same expression that was used
to allocate the destination buffer, but switch to using a separate
variable to hold the length and use that variable for both allocation
and copying, to appease the compiler.

Change-Id: I580083d142fd19a4e7828c915b4846868fa8f917
Reviewed-on: http://gerrit.openafs.org/10818
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/cmd/cmd.c