xcut_str = (unsigned char *) malloc((size_t) (len+1) * sizeof(unsigned char));
xcut_str = (char *) malloc((size_t) (len+1));
void xcut_receive(char *text, int len, rfbClientPtr cl) {	allowed_input_t input;	if (raw_fb && ! dpy) return;	/* raw_fb hack */	if (!watch_selection) {		return;	}	if (view_only) {		return;	}	if (text == NULL || len == 0) {		return;	}	get_allowed_input(cl, &input);	if (!input.keystroke && !input.motion && !input.button) {		/* maybe someday KMBC for cut text... */		return;	}	X_LOCK;	/* associate this text with PRIMARY (and SECONDARY...) */	if (! own_selection) {		own_selection = 1;		/* we need to grab the PRIMARY selection */		XSetSelectionOwner(dpy, XA_PRIMARY, selwin, CurrentTime);		XFlush(dpy);	}	/* duplicate the text string for our own use. */	if (xcut_str != NULL) {		free(xcut_str);	}	xcut_str = (unsigned char *)	    malloc((size_t) (len+1) * sizeof(unsigned char));	strncpy(xcut_str, text, len);	xcut_str[len] = '\0';	/* make sure null terminated */	/* copy this text to CUT_BUFFER0 as well: */	XChangeProperty(dpy, rootwin, XA_CUT_BUFFER0, XA_STRING, 8,	    PropModeReplace, (unsigned char *) text, len);	XFlush(dpy);	X_UNLOCK;	set_cutbuffer = 1;}