Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7b1ef3
)
libht: Fixed the trim bug again. :P
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 31 Aug 2010 22:53:05 +0000
(
00:53
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 31 Aug 2010 22:53:05 +0000
(
00:53
+0200)
lib/req.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/req.c
b/lib/req.c
index
2f975c9
..
b3d9214
100644
(file)
--- a/
lib/req.c
+++ b/
lib/req.c
@@
-95,11
+95,10
@@
static void trim(struct charbuf *buf)
{
char *p;
- if(buf->d > 0) {
-
for(p = buf->b; (p - buf->b < buf->d) && isspace(*p); p++
);
- memmove(buf->b, p, buf->d -= (p - buf->b));
+ for(p = buf->b; (p - buf->b < buf->d) && isspace(*p); p++);
+
memmove(buf->b, p, buf->d -= (p - buf->b)
);
+ if(buf->d > 0)
for(p = buf->b + buf->d - 1; (p > buf->b) && isspace(*p); p--, buf->d--);
- }
}
int parseheaders(struct hthead *head, FILE *in)