diff --git a/screen.c b/screen.c index 40a354c..71eab5a 100644 --- a/screen.c +++ b/screen.c @@ -418,8 +418,11 @@ int cursor_move(H3270 *h, int baddr) if(ret == baddr) return ret; - h->cursor_addr = baddr; - h->update_cursor(h,(unsigned short) (baddr/h->cols),(unsigned short) (baddr%h->cols),h->text[baddr].chr,h->text[baddr].attr); + if(baddr >= 0) + { + h->cursor_addr = baddr; + h->update_cursor(h,(unsigned short) (baddr/h->cols),(unsigned short) (baddr%h->cols),h->text[baddr].chr,h->text[baddr].attr); + } return ret; } -- libgit2 0.21.2