From 8c94f217f3195aba23e8f9e4854a18737384e278 Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 24 Jan 2024 14:02:25 +0000 Subject: [PATCH] fixed header parsing bug git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@60 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/HTTP.c | 5 +++-- W3Version.h.p | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/HTTP.c b/Library/HTTP.c index 336bcf0..9bf2995 100644 --- a/Library/HTTP.c +++ b/Library/HTTP.c @@ -127,9 +127,9 @@ void __W3_HTTP_Request(struct W3* w3) { int j; int incr = 0; int start = 0; - for(j = 1; headerbuf[j] != 0; j++) { + for(j = 1;; j++) { char c = headerbuf[j]; - if(c == '\r') { + if(c == '\r' || c == 0) { headers[incr] = 0; headers[incr + 1] = 0; char* data = __W3_Strdup(headers + start); @@ -156,6 +156,7 @@ void __W3_HTTP_Request(struct W3* w3) { start = incr + 1; incr++; j++; + if(c == 0) break; } else { headers[incr] = c; headers[incr + 1] = 0; diff --git a/W3Version.h.p b/W3Version.h.p index 180169a..3244913 100644 --- a/W3Version.h.p +++ b/W3Version.h.p @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "1.3A" \ +#define LIBW3_VERSION "1.3B" \ SUFFIX #ifdef __cplusplus -- 2.43.0