summaryrefslogtreecommitdiffstats
path: root/mbbsd/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r--mbbsd/board.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 44b4b842..c8ba647f 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -1,4 +1,4 @@
-/* $Id: board.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */
+/* $Id: board.c,v 1.2 2002/03/11 11:12:05 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -242,7 +242,10 @@ void init_brdbuf() {
n = numboards + 4;
size = n * sizeof(int);
zapbuf = (int *) malloc(size);
- favbuf = (int *) malloc(size);
+ favbuf = (int *) malloc(size + sizeof(int));
+
+ favbuf[0] = 0x5c4d3e; /* for check memory */
+ ++favbuf;
memset(favbuf,0,size);
@@ -275,6 +278,14 @@ void save_brdbuf() {
write(fd, zapbuf, size);
close(fd);
}
+ if( favbuf[-1] != 0x5c4d3e ){
+ time_t now;
+ FILE *fp = fopen(BBSHOME "/log/memorybad", "a");
+ time(&now);
+ fprintf(fp, "%s %s %d\n", cuser.userid, Cdatelite(&now), favbuf[-1]);
+ fclose(fp);
+ return;
+ }
setuserfile(fname, STR_FAV);
if((fd = open(fname, O_WRONLY | O_CREAT, 0600)) != -1) {
size = numboards * sizeof(int);