projects
/
darkstat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
828b995
)
Put fewer slashes into the slashed_url.
author
Emil Mikulic
<emikulic@gmail.com>
Mon, 23 May 2011 13:44:52 +0000
(23:44 +1000)
committer
Emil Mikulic
<emikulic@gmail.com>
Sat, 4 Jun 2011 14:00:30 +0000
(
00:00
+1000)
http.c
patch
|
blob
|
history
diff --git
a/http.c
b/http.c
index
418e481
..
4afc8c8
100644
(file)
--- 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 */