Skip to content
Snippets Groups Projects
Commit 2ccb08c8 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Update to previous fix for REP packing

Thanks to TRMB for being the guinea pig, I see now that REP packets can't be opened in append mode because we write and then seek back and write some more in msgtoqwk(). Oops.
parent 540f62d6
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1056 failed
......@@ -33,6 +33,7 @@ bool sbbs_t::pack_rep(uint hubnum)
char hubid_upper[LEN_QWKID+1];
char hubid_lower[LEN_QWKID+1];
int mode;
const char* fmode;
uint i,j,k;
long msgcnt,submsgs,packedmail,netfiles=0,deleted;
uint32_t u;
......@@ -67,11 +68,15 @@ bool sbbs_t::pack_rep(uint hubnum)
/* Create SYSID.MSG, write header and leave open */
/*************************************************/
SAFEPRINTF2(str,"%s%s.MSG",cfg.temp_dir,hubid_upper);
fexistcase(str);
if((rep=fopen(str, "ab"))==NULL) {
errormsg(WHERE, ERR_CREATE, str, 0);
if(fexistcase(str))
fmode="r+b";
else
fmode="w+b";
if((rep=fopen(str, fmode))==NULL) {
errormsg(WHERE, ERR_CREATE, str, 0, fmode);
return false;
}
fseek(rep, 0, SEEK_END);
if(ftell(rep) < 1) { /* New REP packet */
fprintf(rep, "%-*s"
,QWK_BLOCK_LEN, hubid_upper); /* So write header */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment