Change in osmo-bts[master]: common/rsl.c: fix size argument in memcmp() call

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Tue Apr 23 09:36:23 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13740 )

Change subject: common/rsl.c: fix size argument in memcmp() call
......................................................................

common/rsl.c: fix size argument in memcmp() call

Found using clang-8:

  rsl.c:1607:93: warning: size argument in 'memcmp' call
                          is a comparison [-Wmemsize-comparison]
  rsl.c:1607:7: note: did you mean to compare the result of 'memcmp' instead?

It looks more logical to compare the result of memcmp() against
zero instead of passing 'sizeof(sysinfo_buf_t) != 0' as size.

Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5
---
M src/common/rsl.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5287201..8f5d689 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1604,7 +1604,7 @@
 		uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO);
 
 		lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len);
-		if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t) != 0))
+		if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t)) != 0)
 			lchan->si.overridden |= (1 << osmo_si);
 		else
 			lchan->si.overridden &= ~(1 << osmo_si);

-- 
To view, visit https://gerrit.osmocom.org/13740
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5
Gerrit-Change-Number: 13740
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190423/fd88776a/attachment.htm>


More information about the gerrit-log mailing list