diff options
author | 2007-05-29 00:19:10 +0000 | |
---|---|---|
committer | 2007-05-29 00:19:10 +0000 | |
commit | 80566be2fd42462c257a810a11ee376aa6a91bc8 (patch) | |
tree | 99f1119e0c13ee6c88f8fe6b86965e56437131b3 /usr.bin/rcs/rcsutil.c | |
parent | Add a name argument to the RWLOCK_INITIALIZER macro. (diff) | |
download | wireguard-openbsd-80566be2fd42462c257a810a11ee376aa6a91bc8.tar.xz wireguard-openbsd-80566be2fd42462c257a810a11ee376aa6a91bc8.zip |
Since xrealloc dies on failure it is safe to directly assign to the
original pointer. Theo agrees, and so does the rest of the tree
(ssh, etc. all do this already).
Saves a bunch of variables and assignments.
OK niallo@
Diffstat (limited to 'usr.bin/rcs/rcsutil.c')
-rw-r--r-- | usr.bin/rcs/rcsutil.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/rcs/rcsutil.c b/usr.bin/rcs/rcsutil.c index f23279e4678..2dff77b1d21 100644 --- a/usr.bin/rcs/rcsutil.c +++ b/usr.bin/rcs/rcsutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsutil.c,v 1.29 2007/02/27 07:59:13 xsa Exp $ */ +/* $OpenBSD: rcsutil.c,v 1.30 2007/05/29 00:19:10 ray Exp $ */ /* * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -595,7 +595,6 @@ rcs_strsplit(const char *str, const char *sep) { struct rcs_argvector *av; size_t i = 0; - char **nargv; char *cp, *p; cp = xstrdup(str); @@ -605,9 +604,8 @@ rcs_strsplit(const char *str, const char *sep) while ((p = strsep(&cp, sep)) != NULL) { av->argv[i++] = p; - nargv = xrealloc(av->argv, + av->argv = xrealloc(av->argv, i + 1, sizeof(*(av->argv))); - av->argv = nargv; } av->argv[i] = NULL; |