/* metaflac - Command-line FLAC metadata editor
- * Copyright (C) 2001,2002,2003,2004,2005,2006 Josh Coalson
+ * Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include "utils.h"
#include "FLAC/assert.h"
+#include "share/alloc.h"
#include "share/utf8.h"
#include <ctype.h>
#include <stdarg.h>
void local_strcat(char **dest, const char *source)
{
- unsigned ndest, nsource;
+ size_t ndest, nsource;
FLAC__ASSERT(0 != dest);
FLAC__ASSERT(0 != source);
if(nsource == 0)
return;
- *dest = (char*)realloc(*dest, ndest + nsource + 1);
+ *dest = safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1);
if(0 == *dest)
die("out of memory growing string");
strcpy((*dest)+ndest, source);