Fix some warnings about strcpy() etc. on OpenBSD

This commit is contained in:
sin
2013-08-15 12:34:38 +01:00
parent 7d4d519a51
commit 582511d57b
3 changed files with 8 additions and 5 deletions

View File

@@ -17,7 +17,8 @@ afgets(char **p, size_t *size, FILE *fp)
if(len+1 > *size && !(*p = realloc(*p, len+1)))
eprintf("realloc:");
strcpy(&(*p)[len-n], buf);
memcpy(&(*p)[len-n], buf, n);
(*p)[len] = '\0';
if(buf[n-1] == '\n' || feof(fp))
break;