mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed bug in el_build_index()
SVN revision: 127
This commit is contained in:
parent
d47af7c040
commit
3f11875b9b
6
elogd.c
6
elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 2.20 2002/06/14 09:28:40 midas
|
||||||
Show error for URLs like '/logbook/<id>/'
|
Show error for URLs like '/logbook/<id>/'
|
||||||
|
|
||||||
@ -1423,7 +1426,7 @@ struct tm tms;
|
|||||||
|
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
buffer = malloc(length);
|
buffer = malloc(length+1);
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
{
|
{
|
||||||
printf("Not enough memory to allocate file buffer (%d bytes)\n", length);
|
printf("Not enough memory to allocate file buffer (%d bytes)\n", length);
|
||||||
@ -1432,6 +1435,7 @@ struct tm tms;
|
|||||||
|
|
||||||
lseek(fh, 0, SEEK_SET);
|
lseek(fh, 0, SEEK_SET);
|
||||||
read(fh, buffer, length);
|
read(fh, buffer, length);
|
||||||
|
buffer[length] = 0;
|
||||||
close(fh);
|
close(fh);
|
||||||
|
|
||||||
/* go through buffer */
|
/* go through buffer */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user