Commit e4acf79f0fd9649f3d9b091e01fa73e0bea38507
1 parent
ef87acc7
Exists in
master
and in
3 other branches
Corrigindo passagem de coordenadas nas novas funções
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
selection.c
| ... | ... | @@ -465,7 +465,7 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len) |
| 465 | 465 | return NULL; |
| 466 | 466 | |
| 467 | 467 | maxlen = (h->rows * (h->cols+1)) - offset; |
| 468 | - if(maxlen <= 0) | |
| 468 | + if(maxlen <= 0 || offset < 0) | |
| 469 | 469 | return NULL; |
| 470 | 470 | |
| 471 | 471 | if(len < 0 || len > maxlen) |
| ... | ... | @@ -509,7 +509,7 @@ LIB3270_EXPORT char * lib3270_get_text_at(H3270 *h, int row, int col, int len) |
| 509 | 509 | if(!lib3270_connected(h)) |
| 510 | 510 | return NULL; |
| 511 | 511 | |
| 512 | - return lib3270_get_text(h, ((row) * h->cols) + col, len); | |
| 512 | + return lib3270_get_text(h, ((row-1) * h->cols) + (col-1), len); | |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | LIB3270_EXPORT int lib3270_cmp_text_at(H3270 *h, int row, int col, const char *text) | ... | ... |