From 30f87388bb5f28d83f08941d384a48939347f59a Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Sat, 29 Aug 2009 21:40:15 +0000 Subject: [PATCH] clipboard --- sesman/chansrv/clipboard.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c index 9b3839db..4f9f59bb 100644 --- a/sesman/chansrv/clipboard.c +++ b/sesman/chansrv/clipboard.c @@ -58,9 +58,9 @@ static struct stream* g_ins = 0; static XSelectionRequestEvent g_selection_request_event[16]; static int g_selection_request_event_count = 0; -static char* g_data_in; -static int g_data_in_size; -static int g_data_in_time; +static char* g_data_in = 0; +static int g_data_in_size = 0; +static int g_data_in_time = 0; extern int g_cliprdr_chan_id; /* in chansrv.c */ extern Display* g_display; /* in chansrv.c */ @@ -423,7 +423,7 @@ clipboard_process_data_response(struct stream* s, int clip_msg_status, { return 0; } - g_hexdump(s->p, len); + //g_hexdump(s->p, len); wtext = (twchar*)g_malloc(((len / 2) + 1) * sizeof(twchar), 0); if (wtext == 0) { @@ -441,11 +441,13 @@ clipboard_process_data_response(struct stream* s, int clip_msg_status, index++; } wtext[index] = 0; + g_free(g_data_in); + g_data_in = 0; + g_data_in_size = 0; + g_data_in_time = 0; len = g_wcstombs(0, wtext, 0); if (len >= 0) { - g_free(g_data_in); - g_data_in_size = 0; g_data_in = (char*)g_malloc(len + 16, 0); if (g_data_in == 0) {