From da3f2f0d0174675faa1a092722e8298460254112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Fri, 2 Oct 2015 19:51:54 +0200 Subject: Set HOST_NAME_MAX to 255, if it's undefined. Thanks to Jilles and dx. Fixes #309 --- src/irc/core/irc-expandos.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3