Update to FreeBSD 9.2

This commit is contained in:
Sebastian Huber
2013-11-06 16:20:21 +01:00
parent ce96623934
commit 66659ff1ad
596 changed files with 50781 additions and 19477 deletions

View File

@@ -118,6 +118,7 @@ char *
parse_string(FILE *cfile)
{
char *val, *s;
size_t valsize;
int token;
token = next_token(&val, cfile);
@@ -126,10 +127,11 @@ parse_string(FILE *cfile)
skip_to_semi(cfile);
return (NULL);
}
s = malloc(strlen(val) + 1);
valsize = strlen(val) + 1;
s = malloc(valsize);
if (!s)
error("no memory for string %s.", val);
strlcpy(s, val, strlen(val) + 1);
memcpy(s, val, valsize);
if (!parse_semi(cfile))
return (NULL);
@@ -244,6 +246,7 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *buf, int *max,
unsigned char *bufp = buf, *s = NULL;
int token, count = 0;
char *val, *t;
size_t valsize;
pair c = NULL;
if (!bufp && *max) {
@@ -290,10 +293,11 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *buf, int *max,
convert_num(s, val, base, size);
s += size / 8;
} else {
t = malloc(strlen(val) + 1);
valsize = strlen(val) + 1;
t = malloc(valsize);
if (!t)
error("no temp space for number.");
strlcpy(t, val, strlen(val) + 1);
memcpy(t, val, valsize);
c = cons(t, c);
}
} while (++count != *max);