Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit ee041b33 authored by rswindell's avatar rswindell

Added room for NULL terminator to char arrays of MAX_PATH length.

parent 93b724dd
......@@ -240,7 +240,7 @@ void __fastcall TTelnetCfgDlg::RLoginEnabledCheckBoxClick(TObject *Sender)
void __fastcall TTelnetCfgDlg::RLoginIPallowButtonClick(TObject *Sender)
{
char filename[MAX_PATH];
char filename[MAX_PATH+1];
sprintf(filename,"%sRLOGIN.CAN"
,MainForm->cfg.text_dir);
......
......@@ -244,7 +244,7 @@ BOOL filematch(char *filename, char *filespec)
/****************************************************************************/
uint sbbs_t::delfiles(char *inpath, char *spec)
{
char path[MAX_PATH];
char path[MAX_PATH+1];
uint i,files=0;
glob_t g;
......
......@@ -1151,7 +1151,7 @@ char * cmdstr(user_t* user, char *instr, char *fpath, char *fspec, char *cmd)
char str[256];
int i,j,len;
#ifdef _WIN32
char sfpath[MAX_PATH];
char sfpath[MAX_PATH+1];
#endif
len=strlen(instr);
......
......@@ -45,7 +45,7 @@
/****************************************************************************/
void sbbs_t::getnodedat(uint number, node_t *node, bool lockit)
{
char str[MAX_PATH];
char str[MAX_PATH+1];
int count;
if(!number)
......@@ -169,7 +169,7 @@ void sbbs_t::nodesync()
/****************************************************************************/
void sbbs_t::getnmsg()
{
char str[MAX_PATH], HUGE16 *buf;
char str[MAX_PATH+1], HUGE16 *buf;
int file;
long length;
......@@ -215,7 +215,7 @@ void sbbs_t::getnmsg()
/****************************************************************************/
void sbbs_t::getnodeext(uint number, char *ext)
{
char str[MAX_PATH];
char str[MAX_PATH+1];
int count;
if(!number || number>cfg.sys_nodes) {
......@@ -259,7 +259,7 @@ void sbbs_t::getnodeext(uint number, char *ext)
/****************************************************************************/
void sbbs_t::getsmsg(int usernumber)
{
char str[MAX_PATH], HUGE16 *buf;
char str[MAX_PATH+1], HUGE16 *buf;
int file;
long length;
......
......@@ -338,7 +338,7 @@ static char* alias(char* name, char* alias)
char* p=name;
char* np;
char* tp;
char fname[MAX_PATH];
char fname[MAX_PATH+1];
FILE* fp;
sprintf(fname,"%salias.cfg",scfg.ctrl_dir);
......
......@@ -1579,7 +1579,8 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
//****************************************************************************
bool sbbs_t::init()
{
char str[MAX_PATH];
char str[MAX_PATH+1];
char tmp[128];
int result;
uint i,j,k,l;
node_t node;
......@@ -1690,10 +1691,10 @@ bool sbbs_t::init()
now=time(NULL);
struct tm * tm=localtime(&now);
if(tm!=NULL)
sprintf(str,"%02d:%02d%c %s %s %02d %u "
sprintf(str,"%s %s %s %02d %u "
"End of preexisting log entry (possible crash)"
,tm->tm_hour>12 ? tm->tm_hour-12 : tm->tm_hour==0 ? 12 : tm->tm_hour
,tm->tm_min,tm->tm_hour>=12 ? 'p' : 'a',wday[tm->tm_wday]
,hhmmtostr(&cfg,tm,tmp)
,wday[tm->tm_wday]
,mon[tm->tm_mon],tm->tm_mday,tm->tm_year+1900);
logline("L!",str);
log(crlf);
......
......@@ -134,7 +134,7 @@ void sbbs_t::putnmsg(int num, char *strin)
void sbbs_t::putnodeext(uint number, char *ext)
{
char str[MAX_PATH];
char str[MAX_PATH+1];
int count;
if(!number || number>cfg.sys_nodes) {
......
......@@ -293,9 +293,9 @@ public:
uint cursubnum; /* For ARS */
uint curdirnum; /* For ARS */
ulong timeleft; /* Number of seconds user has left online */
char sbbsnode[MAX_PATH]; /* Environment var to contain node dir path */
char sbbsnnum[MAX_PATH]; /* Environment var to contain node num */
char sbbsctrl[MAX_PATH]; /* Environmetn var to contain ctrl dir path */
char sbbsnode[MAX_PATH+1]; /* Environment var to contain node dir path */
char sbbsnnum[MAX_PATH+1]; /* Environment var to contain node num */
char sbbsctrl[MAX_PATH+1]; /* Environmetn var to contain ctrl dir path */
char *comspec; /* Pointer to environment variable COMSPEC */
ushort altul; /* Upload to alternate path flag */
char cid[LEN_CID+1]; /* Caller ID (IP Address) of current caller */
......
......@@ -508,9 +508,9 @@ void sbbs_t::upload(uint dirnum)
/****************************************************************************/
bool sbbs_t::bulkupload(uint dirnum)
{
char str[MAX_PATH];
char path[MAX_PATH];
char spath[MAX_PATH];
char str[MAX_PATH+1];
char path[MAX_PATH+1];
char spath[MAX_PATH+1];
file_t f;
DIR* dir;
DIRENT* dirent;
......
......@@ -586,7 +586,7 @@ char DLLCALL getage(scfg_t* cfg, char *birth)
/****************************************************************************/
int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, char lockit)
{
char str[MAX_PATH];
char str[MAX_PATH+1];
int count;
int file;
......@@ -625,7 +625,7 @@ int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, char lockit)
/****************************************************************************/
int DLLCALL putnodedat(scfg_t* cfg, uint number, node_t* node)
{
char str[MAX_PATH];
char str[MAX_PATH+1];
size_t wr;
int wrerr;
int file;
......@@ -661,7 +661,7 @@ int DLLCALL putnodedat(scfg_t* cfg, uint number, node_t* node)
uint DLLCALL userdatdupe(scfg_t* cfg, uint usernumber, uint offset, uint datlen, char *dat
,BOOL del)
{
char str[MAX_PATH];
char str[MAX_PATH+1];
uint i;
int file;
long l,length;
......
......@@ -102,7 +102,7 @@ int DLLCALL glob(const char *pattern, int flags, void* unused, glob_t* glob)
struct _finddata_t ff;
long ff_handle;
size_t found=0;
char path[MAX_PATH];
char path[MAX_PATH+1];
char* p;
char** new_pathv;
......
......@@ -938,7 +938,7 @@ void sbbs_t::automsg()
{
char str[256],buf[300],anon=0;
char tmp[512];
char automsg[MAX_PATH];
char automsg[MAX_PATH+1];
int file;
sprintf(automsg,"%smsgs/auto.msg",cfg.data_dir);
......
......@@ -983,7 +983,7 @@ char * sbbs_t::cmdstr(char *instr, char *fpath, char *fspec, char *outstr)
break;
case '~': /* DOS-compatible (8.3) filename */
#ifdef _WIN32
char sfpath[MAX_PATH];
char sfpath[MAX_PATH+1];
strcpy(sfpath,fpath);
GetShortPathName(fpath,sfpath,sizeof(sfpath));
strcat(cmd,sfpath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment