$OpenBSD: patch-parsers_c,v 1.4 2001/06/09 04:02:22 angelos Exp $ --- parsers.c.orig Fri Oct 30 22:58:47 1998 +++ parsers.c Fri Jun 8 23:58:26 2001 @@ -224,7 +224,7 @@ list_to_text(struct list *h) struct list *p; char *ret = NULL; char *s; - int size; + int size, l; size = 0; @@ -241,12 +241,13 @@ list_to_text(struct list *h) ret[size] = '\0'; s = ret; - + l = 0; for(p = h->next; p ; p = p->next) { if(p->str) { - strcpy(s, p->str); + l += strlcpy(s, p->str, size - l); s += strlen(s); *s++ = '\r'; *s++ = '\n'; + l += 2; } }