summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/dcc/fe-dcc-send.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2017-06-05 15:58:43 -0300
committerdequis <dx@dxzone.com.ar>2017-06-05 15:58:43 -0300
commit52bb06ccd9f9bd639a454045eba1235e4133b034 (patch)
tree921cc31db8aa3e5a31787d98361782deb98f2e80 /src/fe-common/irc/dcc/fe-dcc-send.c
parent31b9d115b065570020ce9be1a1d8cd49212f70a9 (diff)
downloadirssi-52bb06ccd9f9bd639a454045eba1235e4133b034.zip
fe-dcc-(get|send): Fix some -Wpointer-compare with newer gcc
The warning itself: >warning: comparison between pointer and zero character constant [-Wpointer-compare] Harmless stuff as far as I can tell. The fix adds a null check that probably isn't needed. The old code that compared against '\0' worked a lot like a null check so it makes sense to keep that, while also adding the intended check for empty string. This was visible with "/dcc close send a" showing an empty filename. The equivalent for get didn't show the filename in the format string.
Diffstat (limited to 'src/fe-common/irc/dcc/fe-dcc-send.c')
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-send.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fe-common/irc/dcc/fe-dcc-send.c b/src/fe-common/irc/dcc/fe-dcc-send.c
index 1fc43abd..7920bedc 100644
--- a/src/fe-common/irc/dcc/fe-dcc-send.c
+++ b/src/fe-common/irc/dcc/fe-dcc-send.c
@@ -108,7 +108,7 @@ static void dcc_error_close_not_found(const char *type, const char *nick,
g_return_if_fail(fname != NULL);
if (g_ascii_strcasecmp(type, "SEND") != 0) return;
- if (fname == '\0') fname = "(ANY)";
+ if (fname == NULL || *fname == '\0') fname = "(ANY)";
printformat(NULL, NULL, MSGLEVEL_DCC,
IRCTXT_DCC_SEND_NOT_FOUND, nick, fname);
}