diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-06-12 09:22:07 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-06-12 09:35:43 +0200 |
commit | b0bf1da4c87f1ab3f9367bbeea615dc86d13131c (patch) | |
tree | b04d0e28b3376efdfd4b290d07732270cc63a23f /openbsc/src/libmsc/smpp_vty.c | |
parent | a1c09a401dd68475aad85dd0be23db703da8abea (diff) |
smpp: Only write the systemd-id if it is not empty
system_id is a char array, which makes the NULL check a tautology,
so we should check with strlen if the string is empty or not.
This is fixing the "write" command of VTY that would otherwise
create a config file that can not be parsed.
Diffstat (limited to 'openbsc/src/libmsc/smpp_vty.c')
-rw-r--r-- | openbsc/src/libmsc/smpp_vty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/smpp_vty.c b/openbsc/src/libmsc/smpp_vty.c index adea9590e..a2270e62a 100644 --- a/openbsc/src/libmsc/smpp_vty.c +++ b/openbsc/src/libmsc/smpp_vty.c @@ -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) + if (smsc->system_id && 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); |