From d631f227024181fbce7e5c7093b3c160361bc5b8 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 4 Dec 2016 18:06:20 +1000 Subject: [PATCH] Fix the message counter --- mail_menu.c | 2 +- utils/mgpost/mgpost.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mail_menu.c b/mail_menu.c index 16f0f17..1531392 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -81,7 +81,7 @@ unsigned long generate_msgid() { snprintf(buffer, 1024, "%s/msgserial", conf.bbs_path); - fptr = fopen(buffer, "rw"); + fptr = fopen(buffer, "r+"); if (fptr) { flock(fileno(fptr), LOCK_EX); fread(&lastread, sizeof(time_t), 1, fptr); diff --git a/utils/mgpost/mgpost.c b/utils/mgpost/mgpost.c index 24fea31..d022d03 100644 --- a/utils/mgpost/mgpost.c +++ b/utils/mgpost/mgpost.c @@ -172,7 +172,7 @@ unsigned long generate_msgid(char *bbs_path) { snprintf(buffer, 1024, "%s/msgserial", bbs_path); - fptr = fopen(buffer, "rw"); + fptr = fopen(buffer, "r+"); if (fptr) { flock(fileno(fptr), LOCK_EX); fread(&lastread, sizeof(time_t), 1, fptr);