mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
fix bug in local_strcat()
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user