From b19b2be1608f4ec94b08ae793767c4cec2724641 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Mon, 14 May 2012 10:24:50 +0000 Subject: [PATCH] Movendo buffer de leitura do registry para fora da pilha --- src/lib3270/ctlr.h | 23 ----------------------- src/lib3270/dialogc.h | 20 -------------------- src/lib3270/host.c | 9 --------- src/pw3270/common/config.c | 6 +++++- 4 files changed, 5 insertions(+), 53 deletions(-) delete mode 100644 src/lib3270/ctlr.h delete mode 100644 src/lib3270/dialogc.h diff --git a/src/lib3270/ctlr.h b/src/lib3270/ctlr.h deleted file mode 100644 index 6548621..0000000 --- a/src/lib3270/ctlr.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 1995, 1999, 2000, 2002, 2005 by Paul Mattes. - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation. - * - * x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will - * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE - * for more details. - */ - -/* - * ctlr.h - * External declarations for ctlr.c data structures. - */ - - #warning Deprecated ctlr.h, please remove it - -// extern int buffer_addr; /**< buffer address */ -// extern struct ea *ea_buf; /**< 3270 device buffer */ diff --git a/src/lib3270/dialogc.h b/src/lib3270/dialogc.h deleted file mode 100644 index 320f12e..0000000 --- a/src/lib3270/dialogc.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2002 by Paul Mattes. - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation. - * - * c3270, s3270 and tcl3270 are distributed in the hope that they will - * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE - * for more details. - */ - -/* - * dialogc.h - * Empty definitions for dialog.c. - */ - -#warning deprecated dialogc.h diff --git a/src/lib3270/host.c b/src/lib3270/host.c index eea57ea..0458b77 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -754,12 +754,6 @@ LIB3270_EXPORT void lib3270_register_schange(H3270 *h, LIB3270_STATE_CHANGE tx, h->st_last[tx] = st; - #warning AQUI - if(tx == LIB3270_STATE_CONNECT) - { - trace("%s st=%p func=%p",__FUNCTION__,st,func); - } - } /* Signal a state change. */ @@ -802,9 +796,6 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n) { CHECK_SESSION_HANDLE(h); - #warning AQUI - Trace("%s: %p",__FUNCTION__,n); - if(n && n != h->full_current_host) { char *new_hostname = strdup(n); diff --git a/src/pw3270/common/config.c b/src/pw3270/common/config.c index 02b803a..49402ab 100644 --- a/src/pw3270/common/config.c +++ b/src/pw3270/common/config.c @@ -330,14 +330,16 @@ gchar * get_last_error_msg(void) #ifdef WIN_REGISTRY_ENABLED HKEY key_handle; - BYTE data[4097]; unsigned long datalen = 4096; unsigned long datatype; gchar * ret = NULL; + BYTE * data; if(!registry_open_key(group,KEY_READ,&key_handle)) return g_strdup(def); + data = (BYTE *) g_malloc0(datalen+2); + if(RegQueryValueExA(key_handle,key,NULL,&datatype,data,&datalen) == ERROR_SUCCESS) { data[datalen+1] = 0; @@ -349,6 +351,8 @@ gchar * get_last_error_msg(void) ret = g_strdup(def); } + g_free(data); + RegCloseKey(key_handle); return ret; -- libgit2 0.21.2