Module: kamailio
Branch: 5.1
Commit: 0ed489410b0cd3f34cb030af9ac434bb494fe3ba
URL:
https://github.com/kamailio/kamailio/commit/0ed489410b0cd3f34cb030af9ac434b…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-12-15T11:51:41+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; \
^~~~~
(cherry picked from commit ea056fe4cc4c7b0dce9aaa1423d2fa3d89804b69)
---
Modified: src/modules/uac/uac_reg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0ed489410b0cd3f34cb030af9ac434b…
Patch:
https://github.com/kamailio/kamailio/commit/0ed489410b0cd3f34cb030af9ac434b…
---
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);