diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index baec023..0b1c8bc 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -142,9 +142,8 @@ void ctlr_reinit(H3270 *session, unsigned cmask) session->buffer[1] = tmp = lib3270_calloc(sizeof(struct lib3270_ea),sz+1,session->buffer[1]); session->aea_buf = tmp + 1; - session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); - - Replace(session->zero_buf, (unsigned char *)Calloc(sizeof(struct lib3270_ea),sz)); + session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); + session->zero_buf = lib3270_calloc(sizeof(struct lib3270_ea),sz,session->zero_buf); session->cursor_addr = 0; session->buffer_addr = 0; @@ -247,23 +246,6 @@ const char * lib3270_get_model(H3270 *hSession) return hSession->model_name; } -/** - * Deal with the relationships between model numbers and rows/cols. - * - * @param hSession Session handle. - * @param model New model (updates model name) - */ /* -int lib3270_set_model(H3270 *hSession, int model) -{ - if(CONNECTED) - return EBUSY; - - ctlr_set_rows_cols(hSession,model,hSession->ov_cols,hSession->ov_rows); - ctlr_reinit(hSession,MODEL_CHANGE); - screen_update(hSession,0,hSession->rows*hSession->cols); - return 0; -} */ - int lib3270_set_model(H3270 *hSession, const char *model) { int ovc, ovr; diff --git a/src/lib3270/screenc.h b/src/lib3270/screenc.h index 52dc6fd..c0be19a 100644 --- a/src/lib3270/screenc.h +++ b/src/lib3270/screenc.h @@ -39,10 +39,6 @@ #define display_height() 1 #define display_widthMM() 100 #define display_width() 1 -// #define screen_obscured() False -// #define screen_scroll() screen_disp() -// #define screen_132() /* */ -// #define screen_80() /* */ LIB3270_INTERNAL int screen_init(H3270 *session); // LIB3270_INTERNAL Boolean screen_new_display_charsets(char *cslist, char *csname); diff --git a/src/lib3270/ssl.c b/src/lib3270/ssl.c index 44e9539..b797a4a 100644 --- a/src/lib3270/ssl.c +++ b/src/lib3270/ssl.c @@ -95,19 +95,22 @@ int ssl_negotiate(H3270 *hSession) if (rv != 1) { - int ssl_error = SSL_get_error(hSession->ssl_con,rv); + int ssl_error = SSL_get_error(hSession->ssl_con,rv); + const char * msg = ""; if(ssl_error == SSL_ERROR_SYSCALL && hSession->ssl_error) ssl_error = hSession->ssl_error; - trace_dsn(hSession,"SSL_connect failed: %s %s\n",ERR_lib_error_string(hSession->ssl_error),ERR_reason_error_string(hSession->ssl_error)); + msg = ERR_lib_error_string(ssl_error); + + trace_dsn(hSession,"SSL_connect failed: %s %s\n",msg,ERR_reason_error_string(hSession->ssl_error)); lib3270_popup_dialog( hSession, LIB3270_NOTIFY_ERROR, N_( "Security error" ), N_( "SSL Connect failed" ), - "%s",ERR_lib_error_string(ssl_error) + "%s",msg ? msg : "" ); lib3270_disconnect(hSession); diff --git a/src/lib3270/telnet.c b/src/lib3270/telnet.c index b9b7dd0..c6d4e1c 100644 --- a/src/lib3270/telnet.c +++ b/src/lib3270/telnet.c @@ -996,6 +996,8 @@ void net_input(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno) CHECK_SESSION_HANDLE(hSession); + memset(buffer,0,BUFSZ); + #if defined(_WIN32) for (;;) #endif diff --git a/src/lib3270/valgrind.suppression b/src/lib3270/valgrind.suppression index e69de29..88b3c1e 100644 --- a/src/lib3270/valgrind.suppression +++ b/src/lib3270/valgrind.suppression @@ -0,0 +1,14 @@ +{ + addch + Memcheck:Cond + fun:addch + fun:screen_update + fun:screen_disp + fun:status_reset + fun:defer_unlock + fun:lib3270_default_event_dispatcher + fun:lib3270_main_iterate + fun:mainloop + fun:main +} + -- libgit2 0.21.2