X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/76129c715c6038821afafa1bcdc6974c4fec7ae5..5a9bf7646e1e86a8c24570d571e7e7507517700e:/unix/pterm.c?ds=sidebyside diff --git a/unix/pterm.c b/unix/pterm.c index c52b9208..f23f07b7 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -1371,7 +1371,7 @@ char * retrieve_cutbuffer(int * nbytes) { char * ptr; ptr = XFetchBytes(GDK_DISPLAY(), nbytes); - if (nbytes <= 0 && ptr != 0) { + if (*nbytes <= 0 && ptr != 0) { XFree(ptr); ptr = 0; } @@ -1424,7 +1424,10 @@ void write_clip(void *frontend, wchar_t * data, int len, int must_deselect) memcpy(inst->pasteout_data_ctext, tp.value, tp.nitems); inst->pasteout_data_ctext_len = tp.nitems; XFree(tp.value); - } + } else { + inst->pasteout_data_ctext = NULL; + inst->pasteout_data_ctext_len = 0; + } } else { inst->pasteout_data_utf8 = NULL; inst->pasteout_data_utf8_len = 0; @@ -3367,7 +3370,8 @@ int pt_main(int argc, char **argv) error = inst->back->init((void *)inst, &inst->backhandle, &inst->cfg, inst->cfg.host, inst->cfg.port, - &realhost, inst->cfg.tcp_nodelay); + &realhost, inst->cfg.tcp_nodelay, + inst->cfg.tcp_keepalives); if (error) { char *msg = dupprintf("Unable to open connection to %s:\n%s",