Commit 96f5db93 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

winwidget: hostname always has a trailing null byte in the !HOST_NAME_MAX branch

parent 5ab630b5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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));