From 20089651b2aeb13a7ad374d19b2fc3b26b29455a Mon Sep 17 00:00:00 2001 From: snowdrop Date: Wed, 17 Dec 2003 13:48:37 +0000 Subject: bugfix in hurl_new() --- nanohttp/nanohttp-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanohttp/nanohttp-common.c b/nanohttp/nanohttp-common.c index bb4cde9..e13276d 100644 --- a/nanohttp/nanohttp-common.c +++ b/nanohttp/nanohttp-common.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-common.c,v 1.2 2003/12/16 13:16:13 snowdrop Exp $ + * $Id: nanohttp-common.c,v 1.3 2003/12/17 13:48:37 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -255,7 +255,7 @@ hurl_t* hurl_new(const char* urlstr) url->protocol[iprotocol] = '\0'; size = ihost - iprotocol - 3; - url->host = (char*)malloc(sizeof(char)*size); + url->host = (char*)malloc(sizeof(char)*size + 1); strncpy(url->host, &urlstr[iprotocol+3], size); url->host[size] = '\0'; -- cgit v1.1-32-gdbae