diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-08-31 20:23:31 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-08-31 20:23:31 +0200 |
commit | 96f5db936b65560333fed8eaee74c2e19b2c2e12 (patch) | |
tree | c4b3a13978e8ffb50c8077e17e0d1a1eb717de9a | |
parent | 5ab630b59fe449c451d3a6f024d3c997af020a22 (diff) |
winwidget: hostname always has a trailing null byte in the !HOST_NAME_MAX branch
-rw-r--r-- | src/winwidget.c | 1 |
1 files changed, 0 insertions, 1 deletions
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)); |