Initialize content_{len,buf} always
[yaz-moved-to-github.git] / src / zgdu.c
index 7fd3c73..15683d4 100644 (file)
@@ -1,15 +1,21 @@
 /*
- * Copyright (c) 2002-2003, Index Data.
+ * Copyright (c) 2002-2004, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: zgdu.c,v 1.6 2004-02-19 23:21:44 adam Exp $
+ * $Id: zgdu.c,v 1.8 2004-02-25 10:37:02 adam Exp $
  */
 
+#include <ctype.h>
 #include <yaz/odr.h>
 #include <yaz/yaz-version.h>
 #include <yaz/yaz-iconv.h>
 #include <yaz/zgdu.h>
 
+#ifdef WIN32
+#define strncasecmp _strnicmp
+#define strcasecmp _stricmp
+#endif
 static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
                                   char **content_buf, int *content_len)
 {
@@ -241,6 +247,9 @@ int z_GDU (ODR o, Z_GDU **p, int opt, const char *name)
 
             hr = (*p)->u.HTTP_Response = (Z_HTTP_Response *)
                 odr_malloc(o, sizeof(*hr));
+            hr->content_buf = 0;
+           hr->content_len = 0;
+
             po = i = 5;
             while (i < o->size-2 && o->buf[i] != ' ' && o->buf[i] != '\r')
                 i++;