dtappbuilder: Coverity fixes for mising return value and copy into fixed size buffer

This commit is contained in:
Peter Howkins
2018-04-26 01:36:02 +01:00
parent 4007d3a460
commit bb9eef427f
29 changed files with 81 additions and 82 deletions

View File

@@ -218,11 +218,9 @@ int
abil_print_load_err(int errmsg)
{
static BOOL errmsg_tbl_init = FALSE;
char msg[1024];
char msg[1024] = "";
int msgLen = 0;
*msg = 0;
*msg = 0;
/*
** Load up the error message table if this is the first time we've
** needed to output an error message.
@@ -240,11 +238,11 @@ abil_print_load_err(int errmsg)
if (!abil_loadmsg_err_printed())
{
if(Errormsg[errmsg].msg_id < 0) {
strcat(msg, catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 33,
snprintf(msg, sizeof(msg), "%s", catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 33,
"syntax error"));
}
else {
strcat(msg,
snprintf(msg, sizeof(msg), "%s",
catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET,
Errormsg[errmsg].msg_id,
Errormsg[errmsg].def_str));