]> err.no Git - varnish/commitdiff
Bandaid until Dag Erling does what's necessary
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 21 Aug 2006 17:49:39 +0000 (17:49 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 21 Aug 2006 17:49:39 +0000 (17:49 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@874 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/tcp.c

index ac38dbca5f39b397d637df0eadc8e2e433533e9b..d59afe60e4e370aad051a24b3f8179f249dff76e 100644 (file)
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -74,6 +75,19 @@ accept_filter(int fd)
 }
 #endif
 
+static char *
+strndup(const char *p, unsigned n)
+{
+       char *q;
+
+       q = malloc(n + 1);
+       if (q != NULL) {
+               memcpy(q, p, n);
+               q[n] = '\0';
+       }
+       return (q);
+}
+
 int
 TCP_parse(const char *str, char **addr, char **port)
 {