Rewrote htparser to handle both HTTP/1.0 and HTTP/1.1.
[ashd.git] / lib / utils.c
index 2734410..2ecae5a 100644 (file)
@@ -201,3 +201,16 @@ void bprintf(struct charbuf *buf, char *format, ...)
     bvprintf(buf, format, args);
     va_end(args);
 }
+
+void replstr(char **p, char *n)
+{
+    char *tmp;
+    
+    tmp = *p;
+    if(n)
+       *p = sstrdup(n);
+    else
+       *p = NULL;
+    if(tmp)
+       free(tmp);
+}