]> git.michaelhowe.org Git - packages/o/openafs.git/commit
libafscp: Use strdup, rather than rolling our own
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 30 Mar 2012 18:18:47 +0000 (19:18 +0100)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 28 May 2015 12:52:41 +0000 (08:52 -0400)
commit9a324f14e7c98a302d7276d7c151ccef9242c9f9
tree2d014e4af1a9d79e6eea94c7ccf643b81c5e65ed
parent7dff0032992eac3c078f03e520aee5fed00f2b21
libafscp: Use strdup, rather than rolling our own

   A = malloc(strlen(B)+ 1);
   memset(A, 0, strlen(B) + 1);
   strlcpy(A, B, strlen(B) + 1);
can be more simply written as
   A = strdup(B);

Doing so also avoids a warning from clang that strlcpy isn't checking
for A overflowing.

Reviewed-on: http://gerrit.openafs.org/7077
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 1e30c00e7d9b45d65e819d39414939f2d5f7631b)

Change-Id: I886bef77fdedb63d1c83e657c25d112e0a635db2
Reviewed-on: http://gerrit.openafs.org/11844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libafscp/afscp_server.c