Skip to content
Snippets Groups Projects
Commit 0d87641d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow chat with nodes that are in other-than "in use" status

(e.g. logon, new-user, quiet mode) - these are value node status values
with a user on the node.

Also address GCC warnings about unsafe sprintf usage, e.g.
warning: ‘%s’ directive writing up to 79 bytes into a region of size 59
parent 8b0d149b
No related branches found
No related tags found
No related merge requests found
......@@ -189,7 +189,7 @@ int dospy(int nodenum, bbs_startup_t *bbs_startup) {
return(-1);
case SPY_NOCONNECT:
sprintf(str2,"Failed to connect to %s",str);
SAFEPRINTF(str2,"Failed to connect to %s",str);
uifc.msg(str2);
return(-1);
......@@ -220,7 +220,7 @@ int sendmessage(scfg_t *cfg, int nodenum,node_t *node) {
char str[80],str2[80];
uifc.input(WIN_MID|WIN_SAV,0,0,"Telegram",str2,58,K_WRAP|K_MSG);
sprintf(str,"\1n\1y\1hMessage From Sysop:\1w %s\r\n",str2);
SAFEPRINTF(str,"\1n\1y\1hMessage From Sysop:\1w %s\r\n",str2);
if(getnodedat(cfg,nodenum,node,FALSE,NULL))
return(-1);
if(node->useron==0)
......@@ -1192,7 +1192,7 @@ USAGE:
uifc.msg("Error reading node data!");
continue;
}
if((node.status==NODE_INUSE) && node.useron) {
if(node.status >= NODE_INUSE && node.status <= NODE_QUIET && node.useron) {
int result = chat(&cfg,main_dflt,&node,&boxch,NULL);
if(result != 0)
uifc.msgf("Chat error: %d (%s)", result, strerror(errno));
......@@ -1261,7 +1261,7 @@ USAGE:
continue;
if(j<=cfg.sys_nodes && j>0) {
if((node.status==NODE_INUSE) && node.useron) {
if(node.status >= NODE_INUSE && node.status <= NODE_QUIET && node.useron) {
i=0;
strcpy(opt[i++],"Edit User");
strcpy(opt[i++],"Spy on node");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment