OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-2539-g044785d
Gerrit Code Review
gerrit@openafs.org
Thu, 24 May 2012 08:50:21 -0700 (PDT)
The following commit has been merged in the master branch:
commit bd1248ca3988edb230174ff34c3ff79bedcf559e
Author: Simon Wilkinson <sxw@your-file-system.com>
Date: Wed May 16 06:44:30 2012 +0100
Use strdup to copy strings
Where we have
newStr = malloc(strlen(oldStr)+1);
strcpy(newStr, oldStr);
replace these with
newStr = strdup(oldStr);
It's shorter, clearer, and gets rid of a load of occurences of strcpy,
which some compilers are now warning is unsafe (although it isn't in
this context)
Get rid of a number of custom duplicate string functions and replace
them with strdup where the behaviour is identical
Change-Id: If800343a7d13b1ba6362d4570a2a324fa3525250
Reviewed-on: http://gerrit.openafs.org/7450
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afsweb/apache_afs_plugin.c | 3 +--
src/bozo/bnode.c | 12 ++++--------
src/bozo/bosoprocs.c | 6 ++----
src/bozo/bosprototypes.h | 3 ---
src/bozo/cronbnodeops.c | 2 +-
src/bozo/fsbnodeops.c | 9 ---------
src/bucoord/commands.c | 8 ++------
src/bucoord/config.c | 7 ++-----
src/bucoord/dsvs.c | 15 +++++----------
src/bucoord/dump_sched.c | 3 +--
src/bucoord/restore.c | 13 +++----------
src/bucoord/tape_hosts.c | 3 +--
src/bucoord/vol_sets.c | 12 ++++--------
src/budb/server.c | 9 ++-------
src/butc/tcmain.c | 25 ++++++++-----------------
src/butc/tcprocs.c | 8 ++------
src/cmd/cmd.c | 27 +++++++++------------------
src/comerr/error_table.y | 24 +++++++-----------------
src/comerr/error_table_nt.c | 22 ++++++----------------
src/comerr/et_lex.lex.l | 4 ++--
src/comerr/et_lex.lex_nt.c | 4 ++--
src/config/mc.c | 6 ++----
src/gtx/keymap.c | 7 +------
src/kauth/admin_tools.c | 3 +--
src/libadmin/cfg/cfgclient.c | 8 ++------
src/libadmin/cfg/cfgdb.c | 6 ++----
src/libadmin/cfg/cfghost.c | 13 +++----------
src/libadmin/test/bos.c | 3 +--
src/rx/bulktest/bulk_client.c | 13 ++-----------
src/tools/dumpscan/directory.c | 3 +--
src/tools/dumpscan/pathname.c | 3 +--
src/tools/dumpscan/repair.c | 6 ++----
src/tools/dumpscan/stagehdr.c | 9 +++------
src/ubik/ubik.c | 3 +--
src/update/utils.c | 3 +--
src/usd/usd_file.c | 3 +--
src/usd/usd_nt.c | 3 +--
src/uss/uss_procs.c | 6 ++----
src/uss/uss_vol.c | 6 ++----
src/util/dirpath.c | 14 ++++----------
src/util/ktime.c | 3 +--
src/venus/fstrace.c | 6 ++----
src/vfsck/main.c | 10 +++-------
src/viced/afsfileprocs.c | 9 ++-------
src/vol/partition.c | 6 ++----
src/vol/test/listVicepx.c | 4 +---
src/vol/test/utilities.c | 3 +--
src/vol/vol-salvage.c | 8 ++------
48 files changed, 111 insertions(+), 275 deletions(-)
--
OpenAFS Master Repository