--- xclib.c.orig 2005-07-09 18:03:59.000000000 -0400 +++ xclib.c 2005-07-09 18:04:41.000000000 -0400 @@ -107,9 +107,6 @@ unsigned char *buffer; unsigned long pty_size, pty_items; - /* local buffer of text to return */ - unsigned char *ltxt; - pty = XInternAtom(dpy, "XCLIP_OUT", False); switch (*context) @@ -197,12 +194,12 @@ XDeleteProperty(dpy, win, pty); /* copy the buffer to the pointer for returned data */ - ltxt = (unsigned char *)xcmalloc(pty_items); - memcpy(ltxt, buffer, pty_items); + (*txt) = (unsigned char *)xcmalloc(pty_items); + memcpy((*txt), buffer, pty_items); /* set the length of the returned data */ *len = pty_items; - *txt = ltxt; + *txt = (*txt); /* free the buffer */ XFree(buffer); @@ -289,21 +286,21 @@ if (*len == 0) { *len = pty_items; - ltxt = (unsigned char *)xcmalloc(*len); + (*txt) = (unsigned char *)xcmalloc(*len); } else { *len += pty_items; - ltxt = (unsigned char *)xcrealloc(ltxt, *len); + (*txt) = (unsigned char *)xcrealloc((*txt), *len); } - /* add data to ltxt */ + /* add data to (*txt) */ memcpy( - <xt[*len - pty_items], + &(*txt)[*len - pty_items], buffer, pty_items ); - *txt = ltxt; + *txt = (*txt); /* delete property to get the next item */ XDeleteProperty(dpy, win, pty);