mirror of
https://github.com/sheumann/hush.git
synced 2024-12-25 03:32:18 +00:00
Remove/replace the "div" call.
This commit is contained in:
parent
8f7a4ad442
commit
2439a59828
12
more.c
12
more.c
@ -184,12 +184,14 @@ extern int more_main(int argc, char **argv)
|
|||||||
/* Adjust the terminal height for any overlap, so that
|
/* Adjust the terminal height for any overlap, so that
|
||||||
* no lines get lost off the top. */
|
* no lines get lost off the top. */
|
||||||
if (len >= terminal_width) {
|
if (len >= terminal_width) {
|
||||||
div_t result = div( len, terminal_width);
|
int quot, rem;
|
||||||
if (result.quot) {
|
quot = len / terminal_width;
|
||||||
if (result.rem)
|
rem = len - (quot * terminal_width);
|
||||||
page_height-=result.quot;
|
if (quot) {
|
||||||
|
if (rem)
|
||||||
|
page_height-=quot;
|
||||||
else
|
else
|
||||||
page_height-=(result.quot-1);
|
page_height-=(quot-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (++lines >= page_height) {
|
if (++lines >= page_height) {
|
||||||
|
@ -184,12 +184,14 @@ extern int more_main(int argc, char **argv)
|
|||||||
/* Adjust the terminal height for any overlap, so that
|
/* Adjust the terminal height for any overlap, so that
|
||||||
* no lines get lost off the top. */
|
* no lines get lost off the top. */
|
||||||
if (len >= terminal_width) {
|
if (len >= terminal_width) {
|
||||||
div_t result = div( len, terminal_width);
|
int quot, rem;
|
||||||
if (result.quot) {
|
quot = len / terminal_width;
|
||||||
if (result.rem)
|
rem = len - (quot * terminal_width);
|
||||||
page_height-=result.quot;
|
if (quot) {
|
||||||
|
if (rem)
|
||||||
|
page_height-=quot;
|
||||||
else
|
else
|
||||||
page_height-=(result.quot-1);
|
page_height-=(quot-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (++lines >= page_height) {
|
if (++lines >= page_height) {
|
||||||
|
Loading…
Reference in New Issue
Block a user