summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/irc-expandos.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/irc/core/irc-expandos.c b/src/irc/core/irc-expandos.c
index 0c0da643..a1030624 100644
--- a/src/irc/core/irc-expandos.c
+++ b/src/irc/core/irc-expandos.c
@@ -87,11 +87,13 @@ static char *expando_cumode(SERVER_REC *server, void *item, int *free_ret)
{
if (IS_IRC_CHANNEL(item) && CHANNEL(item)->ownnick) {
char prefix = NICK(CHANNEL(item)->ownnick)->prefixes[0];
- char *cumode = g_malloc(2);
- cumode[0] = prefix;
- cumode[1] = '\0';
- *free_ret = TRUE;
- return cumode; /* will be "\0\0" = "" if there is no prefix */
+ if (prefix != '\0') {
+ char *cumode = g_malloc(2);
+ cumode[0] = prefix;
+ cumode[1] = '\0';
+ *free_ret = TRUE;
+ return cumode;
+ }
}
return "";
}