[sr-dev] git:master:44d17221: app_java: fix compiler warning

Victor Seva linuxmaniac at torreviejawireless.org
Tue Jun 7 12:19:55 CEST 2016


Module: kamailio
Branch: master
Commit: 44d17221c3a72401b1d3157cc969acf07cb80bd0
URL: https://github.com/kamailio/kamailio/commit/44d17221c3a72401b1d3157cc969acf07cb80bd0

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2016-06-06T12:05:39+02:00

app_java: fix compiler warning

> java_msgobj.c:233:80: warning: comparison of array 'msg->add_to_branch_s' equal to a null pointer is always false [-Wtautological-pointer-compare]
>     jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0 || msg->add_to_branch_s == NULL) ? "" : strdup(msg->add_to_branch_s));
>                                                                           ~~~~~^~~~~~~~~~~~~~~    ~~~~
> 1 warning generated.

---

Modified: modules/app_java/java_msgobj.c

---

Diff:  https://github.com/kamailio/kamailio/commit/44d17221c3a72401b1d3157cc969acf07cb80bd0.diff
Patch: https://github.com/kamailio/kamailio/commit/44d17221c3a72401b1d3157cc969acf07cb80bd0.patch

---

diff --git a/modules/app_java/java_msgobj.c b/modules/app_java/java_msgobj.c
index 0a43786..fc32849 100644
--- a/modules/app_java/java_msgobj.c
+++ b/modules/app_java/java_msgobj.c
@@ -230,7 +230,7 @@ jobject *fill_sipmsg_object(JNIEnv *env, struct sip_msg *msg)
         LM_ERR("%s: Can't find symbol org.siprouter.SipMsg.add_to_branch_s\n", APP_NAME);
         return NULL;
     }
-    jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0 || msg->add_to_branch_s == NULL) ? "" : strdup(msg->add_to_branch_s));
+    jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0) ? "" : strdup(msg->add_to_branch_s));
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
     if ((*env)->ExceptionCheck(env))
     {




More information about the sr-dev mailing list