Changeset 68f1254c in mainline for uspace/lib/c/generic/io/chargrid.c


Ignore:
Timestamp:
2018-12-30T11:49:13Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e8d3165e
Parents:
59cce22
Message:

Terminal/console need to handle invalid coordinates

chargrid_set_cursor asserted that arguments are valid yet they are passed
directly from client by terminal/console. Chargrid is probably best
positioned to validate the agruments so instead of assert, check
the arguments and don't do anything if they are invalid.

tinput was clearly forgetting about some cases where the screen could have
scrolled so simply call tinput_update_origin every time from
tinput_position_caret. This was happenning when the input line was
longer than one screen row and tab completion was invoked
(which caused assertion failure in chargrid).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/chargrid.c

    r59cce22 r68f1254c  
    263263void chargrid_set_cursor(chargrid_t *scrbuf, sysarg_t col, sysarg_t row)
    264264{
     265        if (col >= scrbuf->cols || row >= scrbuf->rows)
     266                return;
     267
    265268        scrbuf->col = col;
    266269        scrbuf->row = row;
Note: See TracChangeset for help on using the changeset viewer.