Commit 38a300966ef5b99c12dc8a7c94a0aca42f285f14

Authored by Perry Werneck
1 parent 406d745d
Exists in master and in 2 other branches develop, macos

Fixes from lgtm.com

Showing 2 changed files with 19 additions and 11 deletions   Show diff stats
src/core/ctlr.c
@@ -205,7 +205,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) @@ -205,7 +205,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr)
205 // popup_an_error(session,"Invalid %s %dx%d:\nToo big",ResOversize, ovc, ovr); 205 // popup_an_error(session,"Invalid %s %dx%d:\nToo big",ResOversize, ovc, ovr);
206 206
207 } 207 }
208 - else if (ovc > 0 && ovc < session->max.cols) 208 + else if (ovc < session->max.cols)
209 { 209 {
210 210
211 lib3270_popup_dialog( 211 lib3270_popup_dialog(
@@ -219,7 +219,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) @@ -219,7 +219,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr)
219 219
220 // popup_an_error(session,"Invalid %s cols (%d):\nLess than model %d cols (%d)",ResOversize, ovc, session->model_num, session->maxCOLS); 220 // popup_an_error(session,"Invalid %s cols (%d):\nLess than model %d cols (%d)",ResOversize, ovc, session->model_num, session->maxCOLS);
221 } 221 }
222 - else if (ovr > 0 && ovr < session->max.rows) 222 + else if (ovr < session->max.rows)
223 { 223 {
224 224
225 lib3270_popup_dialog( 225 lib3270_popup_dialog(
src/core/linux/connect.c
@@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
89 89
90 case 1: 90 case 1:
91 // Got response. 91 // Got response.
92 - if(pfd.revents && POLLOUT) { 92 + if(pfd.revents & POLLOUT) {
93 debug("%s: Connection complete",__FUNCTION__); 93 debug("%s: Connection complete",__FUNCTION__);
94 return 0; 94 return 0;
95 } 95 }
@@ -194,15 +194,23 @@ @@ -194,15 +194,23 @@
194 194
195 if(hSession->network.module->getsockopt(hSession, SOL_SOCKET, SO_ERROR, (char *) &err, &len) < 0) 195 if(hSession->network.module->getsockopt(hSession, SOL_SOCKET, SO_ERROR, (char *) &err, &len) < 0)
196 { 196 {
197 - int err = errno; 197 + lib3270_autoptr(char) body = lib3270_strdup_printf(
  198 + _("The System error was '%s' (rc=%d)"),
  199 + strerror(errno),
  200 + errno
  201 + );
  202 +
198 lib3270_disconnect(hSession); 203 lib3270_disconnect(hSession);
199 - lib3270_popup_dialog(  
200 - hSession,  
201 - LIB3270_NOTIFY_ERROR,  
202 - _( "Network error" ),  
203 - _( "Unable to get connection state." ),  
204 - _( "The system error was %s" ), strerror(err)  
205 - ); 204 +
  205 + LIB3270_POPUP popup = {
  206 + .type = LIB3270_NOTIFY_ERROR,
  207 + .title = _( "Network error" ),
  208 + .summary = _( "Unable to get connection state." ),
  209 + .body = body
  210 + };
  211 +
  212 + lib3270_popup(hSession,&popup,0);
  213 +
206 return; 214 return;
207 } 215 }
208 else if(err) 216 else if(err)