X-Git-Url: https://unix4lyfe.org/gitweb/darkstat/blobdiff_plain/828b99551e6baa667a39d13725d936a08f52442b..d2efac37f55050bd07b61d0959a6bf06de4c0ed6:/http.c diff --git a/http.c b/http.c index 418e481..4afc8c8 100644 --- a/http.c +++ b/http.c @@ -896,8 +896,9 @@ static void http_init_base(const char *url) /* make sure that the url has leading and trailing slashes */ urllen = strlen(url); slashed_url = xmalloc(urllen+3); - memset(slashed_url, '/', urllen+2); - memcpy(slashed_url+1, url, urllen); /* don't copy NULL */ + slashed_url[0] = '/'; + memcpy(slashed_url+1, url, urllen); /* don't copy NUL */ + slashed_url[urllen+1] = '/'; slashed_url[urllen+2] = '\0'; /* clean the url */