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 7c24cb64 authored by rswindell's avatar rswindell

Using new SAFECOPY string-copy macro.

parent 973947b6
......@@ -148,8 +148,7 @@ void __fastcall TConfigWizard::FormShow(TObject *Sender)
int status;
memset(&scfg,0,sizeof(scfg));
sprintf(scfg.ctrl_dir,"%.*s",sizeof(scfg.ctrl_dir)-1
,MainForm->CtrlDirectory.c_str());
SAFECOPY(scfg.ctrl_dir,MainForm->CtrlDirectory.c_str());
scfg.size=sizeof(scfg);
char error[256];
if(!load_cfg(&scfg,NULL,FALSE,error)) {
......@@ -182,8 +181,7 @@ void __fastcall TConfigWizard::FormShow(TObject *Sender)
p++;
while(*p && *p<=' ') p++;
truncsp(p);
sprintf(MainForm->mail_startup.dns_server,"%.*s"
,sizeof(MainForm->mail_startup.dns_server),p);
SAFECOPY(MainForm->mail_startup.dns_server,p);
break;
}
}
......@@ -483,8 +481,7 @@ void __fastcall TConfigWizard::VerifyQWK(TObject *Sender)
{
char qwk_id[9];
sprintf(qwk_id,"%.*s",sizeof(qwk_id)-1
,QWKIDEdit->Text.c_str());
SAFECOPY(qwk_id,QWKIDEdit->Text.c_str());
NextButton->Enabled=(
strlen(qwk_id)>=2
&& isalpha(qwk_id[0])
......
......@@ -104,8 +104,7 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender)
char str[128],*p;
DWORD addr;
sprintf(str,"%.*s",sizeof(str)-1
,NetworkInterfaceEdit->Text.c_str());
SAFECOPY(str,NetworkInterfaceEdit->Text.c_str());
p=str;
while(*p && *p<=' ') p++;
if(*p && isdigit(*p)) {
......@@ -129,24 +128,18 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender)
MainForm->FtpAutoStart=AutoStartCheckBox->Checked;
MainForm->FtpLogFile=LogFileCheckBox->Checked;
sprintf(MainForm->ftp_startup.index_file_name,"%.*s"
,sizeof(MainForm->ftp_startup.index_file_name)-1
SAFECOPY(MainForm->ftp_startup.index_file_name
,IndexFileNameEdit->Text.c_str());
sprintf(MainForm->ftp_startup.html_index_file,"%.*s"
,sizeof(MainForm->ftp_startup.html_index_file)-1
SAFECOPY(MainForm->ftp_startup.html_index_file
,HtmlFileNameEdit->Text.c_str());
sprintf(MainForm->ftp_startup.html_index_script,"%.*s"
,sizeof(MainForm->ftp_startup.html_index_script)-1
SAFECOPY(MainForm->ftp_startup.html_index_script
,HtmlJavaScriptEdit->Text.c_str());
sprintf(MainForm->ftp_startup.answer_sound,"%.*s"
,sizeof(MainForm->ftp_startup.answer_sound)-1
SAFECOPY(MainForm->ftp_startup.answer_sound
,AnswerSoundEdit->Text.c_str());
sprintf(MainForm->ftp_startup.hangup_sound,"%.*s"
,sizeof(MainForm->ftp_startup.hangup_sound)-1
SAFECOPY(MainForm->ftp_startup.hangup_sound
,HangupSoundEdit->Text.c_str());
sprintf(MainForm->ftp_startup.hack_sound,"%.*s"
,sizeof(MainForm->ftp_startup.hack_sound)-1
SAFECOPY(MainForm->ftp_startup.hack_sound
,HackAttemptSoundEdit->Text.c_str());
if(DebugTxCheckBox->Checked==true)
......
......@@ -141,8 +141,7 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
char str[128],*p;
DWORD addr;
sprintf(str,"%.*s",sizeof(str)-1
,NetworkInterfaceEdit->Text.c_str());
SAFECOPY(str,NetworkInterfaceEdit->Text.c_str());
p=str;
while(*p && *p<=' ') p++;
if(*p && isdigit(*p)) {
......@@ -169,23 +168,17 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
=DeliveryAttemptsEdit->Text.ToIntDef(10);
MainForm->mail_startup.rescan_frequency=RescanFreqEdit->Text.ToIntDef(300);
sprintf(MainForm->mail_startup.default_user,"%.*s"
,sizeof(MainForm->mail_startup.default_user)-1
SAFECOPY(MainForm->mail_startup.default_user
,DefaultUserEdit->Text.c_str());
sprintf(MainForm->mail_startup.dns_server,"%.*s"
,sizeof(MainForm->mail_startup.dns_server)-1
SAFECOPY(MainForm->mail_startup.dns_server
,DNSServerEdit->Text.c_str());
sprintf(MainForm->mail_startup.relay_server,"%.*s"
,sizeof(MainForm->mail_startup.relay_server)-1
SAFECOPY(MainForm->mail_startup.relay_server
,RelayServerEdit->Text.c_str());
sprintf(MainForm->mail_startup.inbound_sound,"%.*s"
,sizeof(MainForm->mail_startup.inbound_sound)-1
SAFECOPY(MainForm->mail_startup.inbound_sound
,InboundSoundEdit->Text.c_str());
sprintf(MainForm->mail_startup.outbound_sound,"%.*s"
,sizeof(MainForm->mail_startup.outbound_sound)-1
SAFECOPY(MainForm->mail_startup.outbound_sound
,OutboundSoundEdit->Text.c_str());
sprintf(MainForm->mail_startup.pop3_sound,"%.*s"
,sizeof(MainForm->mail_startup.pop3_sound)-1
SAFECOPY(MainForm->mail_startup.pop3_sound
,POP3SoundEdit->Text.c_str());
if(RelayRadioButton->Checked==true)
......
......@@ -60,8 +60,7 @@ void __fastcall TServicesCfgDlg::OKButtonClick(TObject *Sender)
char str[128],*p;
DWORD addr;
sprintf(str,"%.*s",sizeof(str)-1
,NetworkInterfaceEdit->Text.c_str());
SAFECOPY(str,NetworkInterfaceEdit->Text.c_str());
p=str;
while(*p && *p<=' ') p++;
if(*p && isdigit(*p)) {
......@@ -81,11 +80,9 @@ void __fastcall TServicesCfgDlg::OKButtonClick(TObject *Sender)
MainForm->ServicesAutoStart=AutoStartCheckBox->Checked;
sprintf(MainForm->services_startup.answer_sound,"%.*s"
,sizeof(MainForm->services_startup.answer_sound)-1
SAFECOPY(MainForm->services_startup.answer_sound
,AnswerSoundEdit->Text.c_str());
sprintf(MainForm->services_startup.hangup_sound,"%.*s"
,sizeof(MainForm->services_startup.hangup_sound)-1
SAFECOPY(MainForm->services_startup.hangup_sound
,HangupSoundEdit->Text.c_str());
if(HostnameCheckBox->Checked==false)
......
......@@ -115,8 +115,7 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender)
char str[128],*p;
DWORD addr;
sprintf(str,"%.*s",sizeof(str)-1
,TelnetInterfaceEdit->Text.c_str());
SAFECOPY(str,TelnetInterfaceEdit->Text.c_str());
p=str;
while(*p && *p<=' ') p++;
if(*p && isdigit(*p)) {
......@@ -134,8 +133,7 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender)
} else
MainForm->bbs_startup.telnet_interface=0;
sprintf(str,"%.*s",sizeof(str)-1
,RLoginInterfaceEdit->Text.c_str());
SAFECOPY(str,RLoginInterfaceEdit->Text.c_str());
p=str;
while(*p && *p<=' ') p++;
if(*p && isdigit(*p)) {
......@@ -162,11 +160,9 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender)
=XtrnYieldEdit->Text.ToIntDef(10);
MainForm->SysAutoStart=AutoStartCheckBox->Checked;
sprintf(MainForm->bbs_startup.answer_sound,"%.*s"
,sizeof(MainForm->bbs_startup.answer_sound)-1
SAFECOPY(MainForm->bbs_startup.answer_sound
,AnswerSoundEdit->Text.c_str());
sprintf(MainForm->bbs_startup.hangup_sound,"%.*s"
,sizeof(MainForm->bbs_startup.hangup_sound)-1
SAFECOPY(MainForm->bbs_startup.hangup_sound
,HangupSoundEdit->Text.c_str());
if(KeepAliveCheckBox->Checked==true)
MainForm->bbs_startup.options|=BBS_OPT_KEEP_ALIVE;
......
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