Replace (safe) use of strcpy with memcpy to appease OpenBSD

If Libevent uses strcpy, even safely, it seems OpenBSD's linker will
complain every time a library links Libevent.  It's easier just not to
use the old thing, even when it's safe to do so.
This commit is contained in:
Nick Mathewson 2010-05-14 14:36:49 -04:00
parent 75701e897b
commit caca2f451c

6
http.c
View File

@ -249,9 +249,9 @@ evhttp_htmlescape(const char *html)
}
for (i = 0; i < old_size; ++i) {
const char *replaced = html_replace(html[i], scratch_space);
/* this is length checked */
strcpy(p, replaced);
p += strlen(replaced);
size_t len = strlen(replaced);
memcpy(p, replaced, len);
p += len;
}
*p = '\0';