[sr-dev] git:master:2f31e4b4: uac: fix gcc 7 warning

Victor Seva linuxmaniac at torreviejawireless.org
Fri Dec 15 11:44:10 CET 2017


Module: kamailio
Branch: master
Commit: 2f31e4b426d8b98b07b5a816a67326d62f827d3c
URL: https://github.com/kamailio/kamailio/commit/2f31e4b426d8b98b07b5a816a67326d62f827d3c

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2017-12-15T11:44:03+01:00

uac: fix gcc 7 warning

> CC (gcc) [M uac.so]		uac_reg.o
> uac_reg.c: In function 'reg_ht_add':
> uac_reg.c:558:81: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
> uac_reg.c:502:13:
>     p = p + ((bsize)?(bsize):(dst)->len) + 1; \
>              ~~~~~~~
> uac_reg.c:558:81:
>   reg_copy_shm(&nr->callid, &str_empty, reg_keep_callid ? UAC_REG_TM_CALLID_SIZE : 0);
> uac_reg.c:502:14: note: in definition of macro 'reg_copy_shm'
>     p = p + ((bsize)?(bsize):(dst)->len) + 1; \
>               ^~~~~

---

Modified: src/modules/uac/uac_reg.c

---

Diff:  https://github.com/kamailio/kamailio/commit/2f31e4b426d8b98b07b5a816a67326d62f827d3c.diff
Patch: https://github.com/kamailio/kamailio/commit/2f31e4b426d8b98b07b5a816a67326d62f827d3c.patch

---

diff --git a/src/modules/uac/uac_reg.c b/src/modules/uac/uac_reg.c
index d85d51c6a0..4b636a5891 100644
--- a/src/modules/uac/uac_reg.c
+++ b/src/modules/uac/uac_reg.c
@@ -499,7 +499,7 @@ int reg_ht_add_byuser(reg_uac_t *reg)
 			strncpy((dst)->s, (src)->s, (src)->len); \
 			(dst)->len = (src)->len; \
 			(dst)->s[(dst)->len] = '\0'; \
-			p = p + ((bsize)?(bsize):(dst)->len) + 1; \
+			p = p + ((bsize)!=0?(bsize):(dst)->len) + 1; \
 		} \
 	} while(0);
 




More information about the sr-dev mailing list