[PATCH] libsmpp34[master]: bind_receiver_resp_test.c: Fix compilation warning

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Sep 15 18:24:40 UTC 2017


Review at  https://gerrit.osmocom.org/3968

bind_receiver_resp_test.c: Fix compilation warning

/home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c: In function ‘main’:
/home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c:55:58: warning: ‘snprintf’ output
 truncated before the last format character [-Wformat-truncation=]
     snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456");
                                                          ^
/home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c:55:5: note: ‘snprintf’ output 17
bytes into a destination of size 16
     snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456");

Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e
---
M test_pdu/bind_receiver_resp_test.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/68/3968/1

diff --git a/test_pdu/bind_receiver_resp_test.c b/test_pdu/bind_receiver_resp_test.c
index 610effd..e1817e8 100644
--- a/test_pdu/bind_receiver_resp_test.c
+++ b/test_pdu/bind_receiver_resp_test.c
@@ -52,7 +52,7 @@
     b.command_id       = BIND_RECEIVER_RESP;
     b.command_status   = ESME_ROK;
     b.sequence_number  = 1;
-    snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456");
+    snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "123456789012345");
 
     tlv.tag = TLVID_sc_interface_version;
     tlv.length = sizeof(uint8_t);

-- 
To view, visit https://gerrit.osmocom.org/3968
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e
Gerrit-PatchSet: 1
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list