Commit b19b2be1608f4ec94b08ae793767c4cec2724641
1 parent
dd6dc273
Exists in
master
and in
5 other branches
Movendo buffer de leitura do registry para fora da pilha
Showing
4 changed files
with
5 additions
and
53 deletions
Show diff stats
src/lib3270/ctlr.h
@@ -1,23 +0,0 @@ | @@ -1,23 +0,0 @@ | ||
1 | -/* | ||
2 | - * Copyright 1995, 1999, 2000, 2002, 2005 by Paul Mattes. | ||
3 | - * Permission to use, copy, modify, and distribute this software and its | ||
4 | - * documentation for any purpose and without fee is hereby granted, | ||
5 | - * provided that the above copyright notice appear in all copies and that | ||
6 | - * both that copyright notice and this permission notice appear in | ||
7 | - * supporting documentation. | ||
8 | - * | ||
9 | - * x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will | ||
10 | - * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE | ||
12 | - * for more details. | ||
13 | - */ | ||
14 | - | ||
15 | -/* | ||
16 | - * ctlr.h | ||
17 | - * External declarations for ctlr.c data structures. | ||
18 | - */ | ||
19 | - | ||
20 | - #warning Deprecated ctlr.h, please remove it | ||
21 | - | ||
22 | -// extern int buffer_addr; /**< buffer address */ | ||
23 | -// extern struct ea *ea_buf; /**< 3270 device buffer */ |
src/lib3270/dialogc.h
@@ -1,20 +0,0 @@ | @@ -1,20 +0,0 @@ | ||
1 | -/* | ||
2 | - * Copyright 2002 by Paul Mattes. | ||
3 | - * Permission to use, copy, modify, and distribute this software and its | ||
4 | - * documentation for any purpose and without fee is hereby granted, | ||
5 | - * provided that the above copyright notice appear in all copies and that | ||
6 | - * both that copyright notice and this permission notice appear in | ||
7 | - * supporting documentation. | ||
8 | - * | ||
9 | - * c3270, s3270 and tcl3270 are distributed in the hope that they will | ||
10 | - * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE | ||
12 | - * for more details. | ||
13 | - */ | ||
14 | - | ||
15 | -/* | ||
16 | - * dialogc.h | ||
17 | - * Empty definitions for dialog.c. | ||
18 | - */ | ||
19 | - | ||
20 | -#warning deprecated dialogc.h |
src/lib3270/host.c
@@ -754,12 +754,6 @@ LIB3270_EXPORT void lib3270_register_schange(H3270 *h, LIB3270_STATE_CHANGE tx, | @@ -754,12 +754,6 @@ LIB3270_EXPORT void lib3270_register_schange(H3270 *h, LIB3270_STATE_CHANGE tx, | ||
754 | 754 | ||
755 | h->st_last[tx] = st; | 755 | h->st_last[tx] = st; |
756 | 756 | ||
757 | - #warning AQUI | ||
758 | - if(tx == LIB3270_STATE_CONNECT) | ||
759 | - { | ||
760 | - trace("%s st=%p func=%p",__FUNCTION__,st,func); | ||
761 | - } | ||
762 | - | ||
763 | } | 757 | } |
764 | 758 | ||
765 | /* Signal a state change. */ | 759 | /* Signal a state change. */ |
@@ -802,9 +796,6 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n) | @@ -802,9 +796,6 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n) | ||
802 | { | 796 | { |
803 | CHECK_SESSION_HANDLE(h); | 797 | CHECK_SESSION_HANDLE(h); |
804 | 798 | ||
805 | - #warning AQUI | ||
806 | - Trace("%s: %p",__FUNCTION__,n); | ||
807 | - | ||
808 | if(n && n != h->full_current_host) | 799 | if(n && n != h->full_current_host) |
809 | { | 800 | { |
810 | char *new_hostname = strdup(n); | 801 | char *new_hostname = strdup(n); |
src/pw3270/common/config.c
@@ -330,14 +330,16 @@ gchar * get_last_error_msg(void) | @@ -330,14 +330,16 @@ gchar * get_last_error_msg(void) | ||
330 | #ifdef WIN_REGISTRY_ENABLED | 330 | #ifdef WIN_REGISTRY_ENABLED |
331 | 331 | ||
332 | HKEY key_handle; | 332 | HKEY key_handle; |
333 | - BYTE data[4097]; | ||
334 | unsigned long datalen = 4096; | 333 | unsigned long datalen = 4096; |
335 | unsigned long datatype; | 334 | unsigned long datatype; |
336 | gchar * ret = NULL; | 335 | gchar * ret = NULL; |
336 | + BYTE * data; | ||
337 | 337 | ||
338 | if(!registry_open_key(group,KEY_READ,&key_handle)) | 338 | if(!registry_open_key(group,KEY_READ,&key_handle)) |
339 | return g_strdup(def); | 339 | return g_strdup(def); |
340 | 340 | ||
341 | + data = (BYTE *) g_malloc0(datalen+2); | ||
342 | + | ||
341 | if(RegQueryValueExA(key_handle,key,NULL,&datatype,data,&datalen) == ERROR_SUCCESS) | 343 | if(RegQueryValueExA(key_handle,key,NULL,&datatype,data,&datalen) == ERROR_SUCCESS) |
342 | { | 344 | { |
343 | data[datalen+1] = 0; | 345 | data[datalen+1] = 0; |
@@ -349,6 +351,8 @@ gchar * get_last_error_msg(void) | @@ -349,6 +351,8 @@ gchar * get_last_error_msg(void) | ||
349 | ret = g_strdup(def); | 351 | ret = g_strdup(def); |
350 | } | 352 | } |
351 | 353 | ||
354 | + g_free(data); | ||
355 | + | ||
352 | RegCloseKey(key_handle); | 356 | RegCloseKey(key_handle); |
353 | 357 | ||
354 | return ret; | 358 | return ret; |