Use asprintf for string construction
authorSimon Wilkinson <sxw@your-file-system.com>
Wed, 16 May 2012 19:23:41 +0000 (20:23 +0100)
committerDerrick Brashear <shadow@dementix.org>
Thu, 24 May 2012 15:48:35 +0000 (08:48 -0700)
commit044785d587b15e02855b6c9e396d27db962d867a
treeb066182e13e6e38ebce7a4715f44628d0033554b
parentbd1248ca3988edb230174ff34c3ff79bedcf559e
Use asprintf for string construction

Rather than using something along the lines of

    strOut = malloc(strlen(strA) + strlen(strB) + strlen(strC) + 1);
    strcpy(strOut, strA);
    strcat(strOut, strB);
    strcat(strOut, strC);

use asprintf for string construction, so we can just write

    asprintf(&strOut, "%s%s%s", strA, strB, strC);

roken provides an implementation of asprintf for platforms which are
missing one.

Change-Id: Ieef9f4b65f72260c0d372cdf3865daab98733ad9
Reviewed-on: http://gerrit.openafs.org/7451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afsd/afsd_fuse.c
src/afsweb/apache_afs_plugin.c
src/aklog/aklog.c
src/bozo/bnode.c
src/bozo/bosoprocs.c
src/bozo/bosserver.c
src/budb/procs.c
src/budb/server.c
src/ptserver/db_verify.c
src/ptserver/ptutils.c
src/util/dirpath.c