From 3f11875b9b2bf51de46ced136e04cba182e84e56 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 14 Jun 2002 18:34:38 +0000 Subject: [PATCH] Fixed bug in el_build_index() SVN revision: 127 --- elogd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elogd.c b/elogd.c index 4f8fbadc..5db6e4ed 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 2.21 2002/06/14 18:34:38 midas + Fixed bug in el_build_index() + Revision 2.20 2002/06/14 09:28:40 midas Show error for URLs like '/logbook//' @@ -1423,7 +1426,7 @@ struct tm tms; if (length > 0) { - buffer = malloc(length); + buffer = malloc(length+1); if (buffer == NULL) { printf("Not enough memory to allocate file buffer (%d bytes)\n", length); @@ -1432,6 +1435,7 @@ struct tm tms; lseek(fh, 0, SEEK_SET); read(fh, buffer, length); + buffer[length] = 0; close(fh); /* go through buffer */