From b13196dea30aa8bd4c530373632285716375e32d Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 14 Aug 2017 21:18:41 +0200 Subject: smpp: Fix compilation warning I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 --- openbsc/src/libmsc/smpp_openbsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsc/src/libmsc') diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f2a036dbb..e656376b2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -93,11 +93,11 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { const uint8_t *sms_msg = NULL; + unsigned int sms_msg_len = 0; struct gsm_subscriber *dest; uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - unsigned int sms_msg_len; int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, -- cgit v1.2.3