From 82a7c12e8338288ccb40d213fcc9e15d102aa968 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Thu, 1 Aug 2019 16:42:36 +0100 Subject: remove trailing blank lines in write_file - change check_bound --- screen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index c27ab8b..8e1b8bc 100644 --- a/screen.c +++ b/screen.c @@ -196,11 +196,11 @@ void erase_screen(){ erase_line(i); } -void check_bound(){ - if (x<0) x=0; - else if (x>=WIDTH) x = WIDTH-1; - if (y<0) y=0; - else if (y>=HEIGHT) y = HEIGHT -1; +void check_bound(int *x, int *y){ + if (*x<0) *x=0; + else if (*x>=WIDTH) *x = WIDTH-1; + if (*y<0) *y=0; + else if (*y>=HEIGHT) *y = HEIGHT -1; } void reset_styles(){ @@ -242,7 +242,7 @@ void go_to(int where){ y = HEIGHT/2; break; } - check_bound(); + check_bound(&x, &y); show_cursor(); } @@ -279,7 +279,7 @@ void handle_goto(){ go_to(MIDDLE); break; } - check_bound(); + check_bound(&x, &y); show_cursor(); } -- cgit v1.2.3