diff options
author | KatolaZ <katolaz@freaknet.org> | 2019-08-01 16:42:36 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-08-01 16:42:36 +0100 |
commit | 82a7c12e8338288ccb40d213fcc9e15d102aa968 (patch) | |
tree | 970ca2f39dc599624e53a10e59d05bc908f9b0a2 /screen.c | |
parent | 62713aaf65264950aecad9237d50e911d7dad893 (diff) |
remove trailing blank lines in write_file - change check_bound
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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(); } |