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

Fix incorrect use of sizeof in node_vstatus and node_activity

This would cause the "Logout" status and multinode chat activity
strings to be truncated to 3 or 7 chars.

CID 515713 and 515715
parent 66e7634e
Branches
Tags
No related merge requests found
......@@ -1417,7 +1417,7 @@ char* node_vstatus(scfg_t* cfg, node_t* node, char* str, size_t size)
case NODE_LOGON:
return cfg->text != NULL ? cfg->text[NodeStatusLogon] : "At login prompt";
case NODE_LOGOUT:
snprintf(str, sizeof str, cfg->text != NULL ? cfg->text[NodeStatusLogout] : "Logging out %s", username(cfg,node->useron,tmp));
snprintf(str, size, cfg->text != NULL ? cfg->text[NodeStatusLogout] : "Logging out %s", username(cfg,node->useron,tmp));
return str;
case NODE_EVENT_WAITING:
return cfg->text != NULL ? cfg->text[NodeStatusEventWaiting] : "Waiting for all nodes to become inactive";
......@@ -1509,7 +1509,7 @@ char* node_activity(scfg_t* cfg, node_t* node, char* str, size_t size, int num)
break;
case NODE_MCHT:
if(node->aux != 0)
snprintf(str, sizeof str
snprintf(str, size
,cfg->text != NULL ? cfg->text[NodeActivityChatChannel] : "in multinode chat channel %d"
,node->aux & 0xff);
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment