From c82df7163e4e66bae456e30e6bc6a900072061e7 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Sat, 16 Feb 2002 01:12:32 +0000 Subject: [PATCH] Added O_TRUNC flag to fnopen() call, hopefully fix Unix .rep creation bug. --- src/sbbs3/pack_rep.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/pack_rep.cpp b/src/sbbs3/pack_rep.cpp index 95ae11ac57..0e31e69f0f 100644 --- a/src/sbbs3/pack_rep.cpp +++ b/src/sbbs3/pack_rep.cpp @@ -71,8 +71,8 @@ bool sbbs_t::pack_rep(uint hubnum) /* Create SYSID.MSG, write header and leave open */ /*************************************************/ sprintf(str,"%s%s.msg",cfg.temp_dir,cfg.qhub[hubnum]->id); - if((rep=fnopen(&file,str,O_CREAT|O_WRONLY))==NULL) { - errormsg(WHERE,ERR_OPEN,str,O_CREAT|O_WRONLY); + if((rep=fnopen(&file,str,O_CREAT|O_WRONLY|O_TRUNC))==NULL) { + errormsg(WHERE,ERR_OPEN,str,O_CREAT|O_WRONLY|O_TRUNC); return(false); } if(filelength(file)<1) { /* New REP packet */ sprintf(str,"%-128s",cfg.qhub[hubnum]->id); /* So write header */ -- GitLab