diff options
author | 2009-12-01 10:15:06 +0000 | |
---|---|---|
committer | 2009-12-01 10:15:06 +0000 | |
commit | bbfd9ed0c8d875e3121e5b6c1333df8dc8400f24 (patch) | |
tree | cab18d3367fe9721234ec7f0497cf5284e8314ff /xfuncs.c | |
parent | add SHT decoding and tweak undefined strings to not use spaces (diff) | |
download | pax-utils-bbfd9ed0c8d875e3121e5b6c1333df8dc8400f24.tar.gz pax-utils-bbfd9ed0c8d875e3121e5b6c1333df8dc8400f24.tar.bz2 pax-utils-bbfd9ed0c8d875e3121e5b6c1333df8dc8400f24.zip |
allow xstrcat to start off with a NULL destination
Diffstat (limited to 'xfuncs.c')
-rw-r--r-- | xfuncs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* * Copyright 2003-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/xfuncs.c,v 1.5 2009/01/31 18:02:13 grobian Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/xfuncs.c,v 1.6 2009/12/01 10:15:06 vapier Exp $ * * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> @@ -65,7 +65,7 @@ void xstrncat(char **dst, const char *src, size_t *curr_len, size_t n) { size_t new_len; - new_len = strlen(*dst) + strlen(src); + new_len = (*curr_len ? strlen(*dst) : 0) + strlen(src); if (*curr_len <= new_len) { *curr_len = new_len + (*curr_len / 2); *dst = realloc(*dst, *curr_len); |