smpp: Checking an array for NULL will always be false

The if (submit->short_message) and if (smsc->system_id) will
always be true.

Fixes: Coverity CID 1042371, CID 1042372
This commit is contained in:
Holger Hans Peter Freyther 2013-07-14 08:50:57 +02:00
parent c9251fa8c9
commit ae9d8d3131
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
}
sms_msg = t->value.octet;
sms_msg_len = t->length;
} else if (submit->short_message && submit->sm_length) {
} else if (submit->sm_length) {
sms_msg = submit->short_message;
sms_msg_len = submit->sm_length;
} else {

View File

@ -119,7 +119,7 @@ static int config_write_smpp(struct vty *vty)
vty_out(vty, "smpp%s", VTY_NEWLINE);
vty_out(vty, " local-tcp-port %u%s", smsc->listen_port, VTY_NEWLINE);
if (smsc->system_id && strlen(smsc->system_id) > 0)
if (strlen(smsc->system_id) > 0)
vty_out(vty, " system-id %s%s", smsc->system_id, VTY_NEWLINE);
vty_out(vty, " policy %s%s",
smsc->accept_all ? "accept-all" : "closed", VTY_NEWLINE);