From 04fc081e6d0ac401e887f90a086c2be0b8c779fa Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Mon, 11 Sep 2000 23:57:43 +0000 Subject: Switched to the new logging style and replaced the xmalloc() with straight malloc(). --- src/uri.c | 23 ++++++++--------------- src/uri.h | 8 ++++---- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/uri.c b/src/uri.c index 7ba352c..2a7925a 100644 --- a/src/uri.c +++ b/src/uri.c @@ -1,4 +1,4 @@ -/* $Id: uri.c,v 1.2 2000-04-26 16:31:29 rjkaes Exp $ +/* $Id: uri.c,v 1.3 2000-09-11 23:57:43 rjkaes Exp $ * * This borrows the REGEX from RFC2396 to split a URI string into the five * primary components. The components are: @@ -21,19 +21,12 @@ * General Public License for more details. */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "tinyproxy.h" -#include -#include -#include -#include - -#include "uri.h" -#include "utils.h" #include "log.h" #include "regexp.h" +#include "uri.h" +#include "utils.h" #define NMATCH 10 @@ -51,7 +44,7 @@ static int extract_uri(regmatch_t pmatch[], const char *buffer, char **section, int substring) { int len = pmatch[substring].rm_eo - pmatch[substring].rm_so; - if ((*section = xmalloc(len + 1)) == NULL) + if ((*section = malloc(len + 1)) == NULL) return -1; memset(*section, '\0', len + 1); @@ -76,17 +69,17 @@ URI *explode_uri(const char *string) regmatch_t pmatch[NMATCH]; regex_t preg; - if (!(uri = xmalloc(sizeof(URI)))) + if (!(uri = malloc(sizeof(URI)))) return NULL; memset(uri, 0, sizeof(URI)); if (regcomp(&preg, URIPATTERN, REG_EXTENDED) != 0) { - log("ERROR explode_uri: regcomp"); + log(LOG_ERR, "explode_uri: regcomp"); goto ERROR_EXIT; } if (regexec(&preg, string, NMATCH, pmatch, 0) != 0) { - log("ERROR explode_uri: regexec"); + log(LOG_ERR, "explode_uri: regexec"); goto ERROR_EXIT; } diff --git a/src/uri.h b/src/uri.h index bb18d15..a66bb3c 100644 --- a/src/uri.h +++ b/src/uri.h @@ -1,4 +1,4 @@ -/* $Id: uri.h,v 1.1.1.1 2000-02-16 17:32:24 sdyoung Exp $ +/* $Id: uri.h,v 1.2 2000-09-11 23:57:43 rjkaes Exp $ * * See 'uri.c' for a detailed description. * @@ -15,8 +15,8 @@ * General Public License for more details. */ -#ifndef __URI_H_ -#define __URI_H_ +#ifndef _TINYPROXY_URI_H_ +#define _TINYPROXY_URI_H_ typedef struct { char *scheme; @@ -27,6 +27,6 @@ typedef struct { } URI; extern URI *explode_uri(const char *string); -extern void free_uri(URI * uri); +extern void free_uri(URI *uri); #endif -- cgit v1.2.3