- Use calloc instead of malloc + memset
- Fix really busted logic proposed in r295191. Use asprintf instead of malloc, then strlcpy to circumvent the warning correctly by automatically creating the right sized buffer. The proposed change I committed was broken from the get-go because it was running strlen on an improperly initialized buffer, so it would have always segfaulted [*]
Reported by: bde [*]