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

Created STRERROR macro that truncates whitespace only in non-Unix build.

parent 27c70b57
Branches
Tags
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,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,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,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,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,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,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,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,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,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,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,truncsp(strerror(errno)),str);
sprintf(error,"%d (%s) opening %s",errno,STRERROR(errno),str);
return(FALSE);
}
......
......@@ -134,6 +134,12 @@ extern "C" {
#endif
#endif
#if defined(__unix__)
#define STRERROR(x) strerror(x)
#else
#define STRERROR(x) truncsp(strerror(x))
#endif
/****************************/
/* Common Utility Functions */
/****************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment