summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@0x90.dk>2015-10-02 19:51:54 +0200
committerAlexander Færøy <ahf@0x90.dk>2015-10-02 19:55:29 +0200
commitda3f2f0d0174675faa1a092722e8298460254112 (patch)
treeeec1badb04043b075dbc9250ce5f5715333212e0 /src
parenta66bb95d0e3d76dfb6abda88d6f128540279b461 (diff)
downloadirssi-da3f2f0d0174675faa1a092722e8298460254112.zip
Set HOST_NAME_MAX to 255, if it's undefined.
Thanks to Jilles and dx. Fixes #309
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/irc-expandos.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/irc/core/irc-expandos.c b/src/irc/core/irc-expandos.c
index 5d8150f0..62ef577a 100644
--- a/src/irc/core/irc-expandos.c
+++ b/src/irc/core/irc-expandos.c
@@ -27,6 +27,10 @@
#include "irc-channels.h"
#include "nicklist.h"
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
static char *last_join;
/* last person to join a channel you are on */
@@ -56,7 +60,7 @@ static char *expando_userhost(SERVER_REC *server, void *item, int *free_ret)
{
IRC_SERVER_REC *ircserver;
const char *username;
- char hostname[HOST_NAME_MAX];
+ char hostname[HOST_NAME_MAX + 1];
ircserver = IRC_SERVER(server);
@@ -80,7 +84,7 @@ static char *expando_userhost(SERVER_REC *server, void *item, int *free_ret)
static char *expando_hostname(SERVER_REC *server, void *item, int *free_ret)
{
IRC_SERVER_REC *ircserver;
- char hostname[HOST_NAME_MAX];
+ char hostname[HOST_NAME_MAX + 1];
char **list;
char *hostname_split;