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);