Module: kamailio Branch: 5.1 Commit: 788f220cd9673ed662399b610e8613478ec8a9ec URL: https://github.com/kamailio/kamailio/commit/788f220cd9673ed662399b610e861347...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2017-12-15T11:51:41+01:00
xmpp: fix gcc 7 warnings
CC (gcc) [M xmpp.so] xode.o xode.c: In function 'xode_get_tag': xode.c:346:77: warning: comparison between pointer and zero character constant [-Wpointer-compare] if(parent == NULL || parent->firstchild == NULL || name == NULL || name == '\0') return NULL; ^~ xode.c:346:72: note: did you mean to dereference the pointer? if(parent == NULL || parent->firstchild == NULL || name == NULL || name == '\0') return NULL; ^ CC (gcc) [M xmpp.so] xstream.o xstream.c: In function '_xode_put_expatattribs': xstream.c:34:20: warning: comparison between pointer and zero character constant [-Wpointer-compare] while (atts[i] != '\0') ^~ xstream.c:34:12: note: did you mean to dereference the pointer? while (atts[i] != '\0') ^ CC (gcc) [M xmpp.so] xode_from.o xode_from.c: In function '_xode_put_expatattribs': xode_from.c:35:20: warning: comparison between pointer and zero character constant [-Wpointer-compare] while (atts[i] != '\0') ^~ xode_from.c:35:12: note: did you mean to dereference the pointer? while (atts[i] != '\0') ^
(cherry picked from commit 8994daba2b60bf020f982f108ab560f9aa68723f)
---
Modified: src/modules/xmpp/xode.c Modified: src/modules/xmpp/xode_from.c Modified: src/modules/xmpp/xstream.c
---
Diff: https://github.com/kamailio/kamailio/commit/788f220cd9673ed662399b610e861347... Patch: https://github.com/kamailio/kamailio/commit/788f220cd9673ed662399b610e861347...
---
diff --git a/src/modules/xmpp/xode.c b/src/modules/xmpp/xode.c index 4909f6345e..8cc086aa3f 100644 --- a/src/modules/xmpp/xode.c +++ b/src/modules/xmpp/xode.c @@ -343,7 +343,7 @@ xode xode_get_tag(xode parent, const char* name) char *str, *slash, *qmark, *equals; xode step, ret;
- if(parent == NULL || parent->firstchild == NULL || name == NULL || name == '\0') return NULL; + if(parent == NULL || parent->firstchild == NULL || name == NULL || *name == '\0') return NULL;
if(strstr(name, "/") == NULL && strstr(name,"?") == NULL) return _xode_search(parent->firstchild, name, XODE_TYPE_TAG); diff --git a/src/modules/xmpp/xode_from.c b/src/modules/xmpp/xode_from.c index 8a78f4ba4d..60d49fa0ca 100644 --- a/src/modules/xmpp/xode_from.c +++ b/src/modules/xmpp/xode_from.c @@ -32,7 +32,7 @@ static void _xode_put_expatattribs(xode current, const char **atts) { int i = 0; if (atts == NULL) return; - while (atts[i] != '\0') + while (*(atts[i]) != '\0') { xode_put_attrib(current, atts[i], atts[i+1]); i += 2; diff --git a/src/modules/xmpp/xstream.c b/src/modules/xmpp/xstream.c index b4367b3aa1..41a6c1e386 100644 --- a/src/modules/xmpp/xstream.c +++ b/src/modules/xmpp/xstream.c @@ -31,7 +31,7 @@ static void _xode_put_expatattribs(xode owner, const char** atts) { int i = 0; if (atts == NULL) return; - while (atts[i] != '\0') + while (*(atts[i]) != '\0') { xode_put_attrib(owner, atts[i], atts[i+1]); i += 2;