From 96f5db936b65560333fed8eaee74c2e19b2c2e12 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 31 Aug 2016 20:23:31 +0200 Subject: winwidget: hostname always has a trailing null byte in the !HOST_NAME_MAX branch --- src/winwidget.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/winwidget.c b/src/winwidget.c index dc1fe13..758183b 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -294,7 +294,6 @@ void winwidget_create_window(winwidget ret, int w, int h) if ((host_name_max = sysconf(_SC_HOST_NAME_MAX)) != -1 ) { if ((hostname = calloc(1, host_name_max + 1)) != NULL ) { if (gethostname(hostname, host_name_max) == 0) { - hostname[host_name_max] = '\0'; prop = XInternAtom(disp, "WM_CLIENT_MACHINE", False); XChangeProperty(disp, ret->win, prop, XA_STRING, sizeof(char) * 8, PropModeReplace, (unsigned char *)hostname, strlen(hostname)); -- cgit v1.2.3