]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
We're coredumping with wierd results on oceana. ->http_ver is set to
authorwessels <>
Tue, 18 Nov 1997 07:47:59 +0000 (07:47 +0000)
committerwessels <>
Tue, 18 Nov 1997 07:47:59 +0000 (07:47 +0000)
some wierd constant and the debugger prints 'Arithmetic error'.
Lets try atof() instead of sscanf().

src/client_side.cc

index bbd59abc2e29303b36174491243eda44a76c6e63..ca9954b78d4250bf30a9d3269077eb9a3181a12d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.152 1997/11/15 00:14:46 wessels Exp $
+ * $Id: client_side.cc,v 1.153 1997/11/18 00:47:59 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1387,10 +1387,21 @@ parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status,
        *status = -1;
        return NULL;
     }
+#ifdef SSCANF_GIVING_ME_TROUBLE
     memset(http_ver_s, '\0', 32);
     xstrncpy(http_ver_s, token, 32);
     sscanf(http_ver_s, "HTTP/%f", &http_ver);
     debug(12, 5) ("parseHttpRequest: HTTP version is '%3.1f'\n", http_ver);
+#else
+    if (strncmp(token, "HTTP/", 5)) {
+       debug(12, 1) ("parseHttpRequest: Missing HTTP identifier ('%s')\n",
+           token);
+       xfree(inbuf);
+       *status = -1;
+       return NULL;
+    }
+    http_ver = (float) atof(token + 5);
+#endif
 
     /* Check if headers are received */
     if ((end = mime_headers_end(t)) == NULL) {