changeset 4816:f1dea39a50bb

Fixed the http response parser when the http header only has the HTTP answer and no field. Fixed some compiler warnings.
author bertrand
date Sat, 23 Feb 2002 07:31:45 +0000
parents 178b524e5213
children 1e46f40dcd0e
files libmpdemux/http.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/http.c	Sat Feb 23 01:38:06 2002 +0000
+++ b/libmpdemux/http.c	Sat Feb 23 07:31:45 2002 +0000
@@ -9,6 +9,7 @@
 #include <string.h>
 
 #include "http.h"
+#include "url.h"
 
 HTTP_header_t *
 http_new_header() {
@@ -146,6 +147,7 @@
 		ptr = hdr_ptr;
 		while( *ptr!='\r' && *ptr!='\n' ) ptr++;
 		len = ptr-hdr_ptr;
+		if( len==0 ) break;
 		field = (char*)realloc(field, len+1);
 		if( field==NULL ) {
 			printf("Memory allocation failed\n");
@@ -256,7 +258,6 @@
 char *
 http_get_next_field( HTTP_header_t *http_hdr ) {
 	char *ptr;
-	int i;
 	HTTP_field_t *field;
 	if( http_hdr==NULL ) return NULL;