projects
/
platform
/
upstream
/
flac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
303123f
)
fix bug in local_strcat()
author
Josh Coalson
<jcoalson@users.sourceforce.net>
Wed, 27 Nov 2002 04:44:24 +0000
(
04:44
+0000)
committer
Josh Coalson
<jcoalson@users.sourceforce.net>
Wed, 27 Nov 2002 04:44:24 +0000
(
04:44
+0000)
src/metaflac/utils.c
patch
|
blob
|
history
diff --git
a/src/metaflac/utils.c
b/src/metaflac/utils.c
index
07edba2
..
3d57f9b
100644
(file)
--- a/
src/metaflac/utils.c
+++ b/
src/metaflac/utils.c
@@
-50,13
+50,13
@@
void local_strcat(char **dest, const char *source)
ndest = *dest? strlen(*dest) : 0;
nsource = strlen(source);
- *dest = realloc(*dest, ndest + nsource);
+ if(nsource == 0)
+ return;
+
+ *dest = realloc(*dest, ndest + nsource + 1);
if(0 == *dest)
die("out of memory growing string");
- if(0 == ndest)
- strcpy(*dest, source);
- else
- strcat(*dest, source);
+ strcpy((*dest)+ndest, source);
}
void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const char *indent)