aports/community/irssi-xmpp/pointer-comparison.patch

47 lines
1.8 KiB
Diff

Patch-Source: https://github.com/cdidier/irssi-xmpp/commit/f85cb98.patch
From f85cb98ff829c96bbdf8d37e113c936f21d20b57 Mon Sep 17 00:00:00 2001
From: Florian Schlichting <fsfs@debian.org>
Date: Sat, 7 Oct 2017 01:22:22 +0200
Subject: [PATCH] fix a comparison between pointer and \0
```
xep/disco.c: In function 'disco_request':
xep/disco.c:72:40: warning: comparison between pointer and zero character constant [-Wpointer-compare]
g_return_if_fail(dest != NULL && dest != '\0');
^
/usr/include/glib-2.0/glib/gmacros.h:379:25: note: in definition of macro 'G_LIKELY'
#define G_LIKELY(expr) (expr)
^~~~
xep/disco.c:72:2: note: in expansion of macro 'g_return_if_fail'
g_return_if_fail(dest != NULL && dest != '\0');
^~~~~~~~~~~~~~~~
xep/disco.c:72:35: note: did you mean to dereference the pointer?
g_return_if_fail(dest != NULL && dest != '\0');
^
/usr/include/glib-2.0/glib/gmacros.h:379:25: note: in definition of macro 'G_LIKELY'
#define G_LIKELY(expr) (expr)
^~~~
xep/disco.c:72:2: note: in expansion of macro 'g_return_if_fail'
g_return_if_fail(dest != NULL && dest != '\0');
^~~~~~~~~~~~~~~~
```
---
src/core/xep/disco.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/xep/disco.c b/src/core/xep/disco.c
index e46e116..184d8d2 100644
--- a/src/core/xep/disco.c
+++ b/src/core/xep/disco.c
@@ -69,7 +69,7 @@ disco_request(XMPP_SERVER_REC *server, const char *dest)
char *recoded;
g_return_if_fail(IS_XMPP_SERVER(server));
- g_return_if_fail(dest != NULL && dest != '\0');
+ g_return_if_fail(dest != NULL && *dest != '\0');
recoded = xmpp_recode_out(dest);
lmsg = lm_message_new_with_sub_type(recoded, LM_MESSAGE_TYPE_IQ,
LM_MESSAGE_SUB_TYPE_GET);