ncdirect: better diagnostics on cursor move errors #1696

This commit is contained in:
nick black 2021-11-04 02:29:42 -04:00 committed by nick black
parent 3792dd5592
commit 435eac59f6

View File

@ -66,6 +66,7 @@ int ncdirect_putegc(ncdirect* nc, uint64_t channels, const char* utf8,
int ncdirect_cursor_up(ncdirect* nc, int num){
if(num < 0){
logerror("requested negative move %d\n", num);
return -1;
}
if(num == 0){
@ -80,6 +81,7 @@ int ncdirect_cursor_up(ncdirect* nc, int num){
int ncdirect_cursor_left(ncdirect* nc, int num){
if(num < 0){
logerror("requested negative move %d\n", num);
return -1;
}
if(num == 0){
@ -94,6 +96,7 @@ int ncdirect_cursor_left(ncdirect* nc, int num){
int ncdirect_cursor_right(ncdirect* nc, int num){
if(num < 0){
logerror("requested negative move %d\n", num);
return -1;
}
if(num == 0){
@ -112,6 +115,7 @@ int ncdirect_cursor_right(ncdirect* nc, int num){
// necessary but performing no carriage return -- a pure line feed.
int ncdirect_cursor_down(ncdirect* nc, int num){
if(num < 0){
logerror("requested negative move %d\n", num);
return -1;
}
if(num == 0){
@ -1245,6 +1249,7 @@ int ncdirect_set_bg_default(ncdirect* nc){
int ncdirect_hline_interp(ncdirect* n, const char* egc, unsigned len,
uint64_t c1, uint64_t c2){
if(len == 0){
logerror("passed zero length\n");
return -1;
}
unsigned ur, ug, ub;
@ -1301,6 +1306,7 @@ int ncdirect_hline_interp(ncdirect* n, const char* egc, unsigned len,
int ncdirect_vline_interp(ncdirect* n, const char* egc, unsigned len,
uint64_t c1, uint64_t c2){
if(len == 0){
logerror("passed zero length\n");
return -1;
}
unsigned ur, ug, ub;