strcpy->memcpy in util_getline

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-16 13:01:30 +02:00
parent 0c74f8fdb9
commit c3bcfe84b0

2
util.c
View file

@ -344,8 +344,8 @@ int util_getline(char **lineptr, size_t *n, FILE *stream) {
if (!tmp) if (!tmp)
return -1; return -1;
memcpy(tmp, *lineptr, pos - *lineptr);
chr = *n + *lineptr - pos; chr = *n + *lineptr - pos;
strcpy(tmp,*lineptr);
if (!(*lineptr = tmp)) { if (!(*lineptr = tmp)) {
mem_d (tmp); mem_d (tmp);
return -1; return -1;