Skip to content
Snippets Groups Projects
Commit 27c70b57 authored by rswindell's avatar rswindell
Browse files

Truncates whitespace (\n) off end of strerror() message. May not work on Unix.

parent f9e5e939
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ BOOL read_node_cfg(scfg_t* cfg, char* error)
strcpy(fname,"node.cnf");
sprintf(str,"%s%s",cfg->node_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,strerror(errno),str);
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
return(FALSE);
}
......@@ -188,7 +188,7 @@ BOOL read_main_cfg(scfg_t* cfg, char* error)
strcpy(fname,"main.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,strerror(errno),str);
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
return(FALSE);
}
......@@ -410,7 +410,7 @@ BOOL read_msgs_cfg(scfg_t* cfg, char* error)
strcpy(fname,"msgs.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,strerror(errno),str);
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
return(FALSE);
}
......
......@@ -51,7 +51,7 @@ BOOL read_file_cfg(scfg_t* cfg, char* error)
strcpy(fname,"file.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,strerror(errno),str);
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
return(FALSE);
}
......@@ -440,7 +440,7 @@ BOOL read_xtrn_cfg(scfg_t* cfg, char* error)
strcpy(fname,"xtrn.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,strerror(errno),str);
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
return(FALSE);
}
......@@ -674,7 +674,7 @@ BOOL read_chat_cfg(scfg_t* cfg, char* error)
strcpy(fname,"chat.cnf");
sprintf(str,"%s%s",cfg->ctrl_dir,fname);
if((instream=fnopen(NULL,str,O_RDONLY))==NULL) {
sprintf(error,"%d (%s) opening %s",errno,strerror(errno),str);
sprintf(error,"%d (%s) opening %s",errno,truncsp(strerror(errno)),str);
return(FALSE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment