r1749 - trunk/varnish-cache/bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Tue Jul 24 15:52:40 CEST 2007


Author: des
Date: 2007-07-24 15:52:40 +0200 (Tue, 24 Jul 2007)
New Revision: 1749

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Use strlen() directly.


Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2007-07-24 13:51:58 UTC (rev 1748)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2007-07-24 13:52:40 UTC (rev 1749)
@@ -884,13 +884,11 @@
 static void
 http_PutField(struct worker *w, int fd, struct http *to, int field, const char *string)
 {
-	const char *e;
 	char *p;
 	int l;
 
 	CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
-	e = strchr(string, '\0');
-	l = (e - string);
+	l = strlen(string);
 	p = WS_Alloc(to->ws, l + 1);
 	if (p == NULL) {
 		WSL(w, SLT_LostHeader, fd, "%s", string);




More information about the varnish-commit mailing list