summaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c14
1 files changed, 7 insertions, 7 deletions
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();
}