Replace broken str* functions with safe versions.

This commit is contained in:
Erik de Castro Lopo
2013-03-19 20:23:44 +11:00
parent 15a011c43d
commit 2d6354ff2a
11 changed files with 96 additions and 61 deletions

View File

@@ -20,15 +20,16 @@
# 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>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
#include "FLAC/assert.h"
#include "share/alloc.h"
#include "share/safe_str.h"
#include "share/utf8.h"
void die(const char *message)
{
@@ -72,7 +73,7 @@ void local_strcat(char **dest, const char *source)
*dest = safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1);
if(0 == *dest)
die("out of memory growing string");
strcpy((*dest)+ndest, source);
safe_strncpy((*dest)+ndest, source, ndest + nsource + 1);
}
void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const char *indent)