From 1e69e30fb233c37954f5298a9118c47fa6fdbdd5 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sat, 6 Apr 1996 06:21:11 +0000 Subject: [PATCH] make sure tmp_error_buf is big enough to hold two URLs use pointers rather than arrays --- src/errorpage.cc | 15 ++++++++++----- src/main.cc | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/errorpage.cc b/src/errorpage.cc index 0641d8e9c4..28c2dac851 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,4 +1,4 @@ -/* $Id: errorpage.cc,v 1.13 1996/04/04 18:41:23 wessels Exp $ */ +/* $Id: errorpage.cc,v 1.14 1996/04/05 23:21:11 wessels Exp $ */ /* DEBUG: Section 4 cached_error: Error printing routines */ @@ -98,13 +98,18 @@ error_data ErrorData[] = }; /* GLOBAL */ -char tmp_error_buf[BUFSIZ]; +char *tmp_error_buf; /* LOCAL */ -static char tbuf[BUFSIZ]; +static char *tbuf; int log_errors = 1; +void errorInitialize() { + tmp_error_buf = (char *) xmalloc(MAX_URL * 4); + tbuf = (char *) xmalloc(MAX_URL * 3); +} + void cached_error_entry(entry, type, msg) StoreEntry *entry; @@ -146,7 +151,7 @@ char *cached_error_url(url, method, type, address, code, msg) { int index; - tmp_error_buf[0] = '\0'; + *tmp_error_buf = '\0'; if (type == ERR_MIN || type > ERR_MAX) fatal_dump("cached_error_url: type out of range."); index = (int) (type - ERR_MIN); @@ -191,7 +196,7 @@ char *cached_error_request(request, type, address, code) { int index; - tmp_error_buf[0] = '\0'; + *tmp_error_buf = '\0'; if (type == ERR_MIN || type > ERR_MAX) fatal_dump("cached_error_url: type out of range."); index = (int) (type - ERR_MIN); diff --git a/src/main.cc b/src/main.cc index f50f57ad6c..c61741751e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,4 +1,4 @@ -/* $Id: main.cc,v 1.19 1996/04/04 22:01:54 wessels Exp $ */ +/* $Id: main.cc,v 1.20 1996/04/05 23:21:12 wessels Exp $ */ /* DEBUG: Section 1 main: startup and main loop */ @@ -53,6 +53,8 @@ int main(argc, argv) int n; /* # of GC'd objects */ time_t last_maintain = 0; + errorInitialize(); + cached_starttime = getCurrentTime(); failure_notify = fatal_dump; -- 2.47.3