aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--format.c2
-rw-r--r--screen.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/format.c b/format.c
index c5ede2bd..ea0a91b1 100644
--- a/format.c
+++ b/format.c
@@ -133,7 +133,7 @@ struct format_tree *
format_create(void)
{
struct format_tree *ft;
- char host[MAXHOSTNAMELEN], *ptr;
+ char host[HOST_NAME_MAX+1], *ptr;
ft = xcalloc(1, sizeof *ft);
RB_INIT(&ft->tree);
diff --git a/screen.c b/screen.c
index 3e3cac53..1b841eed 100644
--- a/screen.c
+++ b/screen.c
@@ -31,11 +31,11 @@ void screen_resize_y(struct screen *, u_int);
void
screen_init(struct screen *s, u_int sx, u_int sy, u_int hlimit)
{
- char host[HOST_NAME_MAX];
+ char host[HOST_NAME_MAX+1];
s->grid = grid_create(sx, sy, hlimit);
- if (gethostname(host, HOST_NAME_MAX) == 0)
+ if (gethostname(host, sizeof(host)) == 0)
s->title = xstrdup(host);
else
s->title = xstrdup("");