Skip to content

Commit

Permalink
Coverity PR: minor refactorings
Browse files Browse the repository at this point in the history
(cherry picked from commit 9750241)

Conflicts:
	modules/ldap/iniparser.c
	modules/usrloc/dlist.c
  • Loading branch information
liviuchircu committed Jan 21, 2016
1 parent 02b4c25 commit 1fedeee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions evi/event_interface.c
Expand Up @@ -509,18 +509,20 @@ struct mi_root * mi_events_list(struct mi_root *cmd_tree, void *param)

static int evi_print_subscriber(struct mi_node *rpl, evi_subs_p subs)
{
evi_reply_sock *sock = subs != NULL ? subs->reply_sock : NULL;
struct mi_node *node = NULL;
evi_reply_sock *sock;
struct mi_node *node;
str socket;

if (!subs->trans_mod || !subs->trans_mod->print) {
LM_ERR("subscriber does not have a print method exported\n");
return -1;
}

node = add_mi_node_child(rpl, 0, "Subscriber", 10, 0, 0);
if(node == NULL)
return -1;

sock = subs->reply_sock;
if (!sock) {
LM_DBG("no socket specified\n");
if (!add_mi_attr(node, 0, "protocol", 8,
Expand Down
5 changes: 3 additions & 2 deletions modules/ldap/iniparser.c
Expand Up @@ -563,8 +563,9 @@ output file pointers.
snprintf(longkey, LONGKEYBUFF, "%s:%s", sec, key);
} else {
size_t len = strlen(sec);
longkey[LONGKEYBUFF-1]=0;
strncpy(longkey, sec, len >= LONGKEYBUFF ? LONGKEYBUFF-1 : len);
if (len > LONGKEYBUFF - 1)
len = LONGKEYBUFF - 1;
strncpy(longkey, sec, len + 1);
}

/* Add (key,val) to dictionary */
Expand Down

0 comments on commit 1fedeee

Please sign in to comment.