From d54236cbc7439b64aed13a4778f3a12958d38aa3 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 20 Sep 2012 12:52:59 +0000 Subject: [PATCH] HLLAPI passa a converter o charset do terminal, funcao lib3270_get_text estava aceitando gets maiores que o tamanho do terminal, implementacao da funcao HLLAPI para obter o buffer do terminal, HLLAPI estava fechando a pipe de comunicacao logo apos a conexao --- selection.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/selection.c b/selection.c index 0bd46d2..b58aefd 100644 --- a/selection.c +++ b/selection.c @@ -464,11 +464,9 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len) if(!lib3270_connected(h)) return NULL; - maxlen = h->rows * (h->cols+1); + maxlen = (h->rows * (h->cols+1)) - offset; - if(len < 0) - len = (maxlen - offset); - else if(len > maxlen) + if(len < 0 || len > maxlen) len = maxlen; buffer = lib3270_malloc(len+1); -- libgit2 0.21.2