diff options
author | Eric Andersen | 2001-05-16 18:53:34 +0000 |
---|---|---|
committer | Eric Andersen | 2001-05-16 18:53:34 +0000 |
commit | 2439a5982876ef4c8ec7291e156e73f244775ba8 (patch) | |
tree | 62dfc4e9bbfa13b87606af98adfeffb3b9705dd3 | |
parent | 8f7a4ad4427614e28f2c51a4caa62c8ad9a78d8f (diff) | |
download | busybox-2439a5982876ef4c8ec7291e156e73f244775ba8.zip busybox-2439a5982876ef4c8ec7291e156e73f244775ba8.tar.gz |
Remove/replace the "div" call.
-rw-r--r-- | more.c | 12 | ||||
-rw-r--r-- | util-linux/more.c | 12 |
2 files changed, 14 insertions, 10 deletions
@@ -184,12 +184,14 @@ extern int more_main(int argc, char **argv) /* Adjust the terminal height for any overlap, so that * no lines get lost off the top. */ if (len >= terminal_width) { - div_t result = div( len, terminal_width); - if (result.quot) { - if (result.rem) - page_height-=result.quot; + int quot, rem; + quot = len / terminal_width; + rem = len - (quot * terminal_width); + if (quot) { + if (rem) + page_height-=quot; else - page_height-=(result.quot-1); + page_height-=(quot-1); } } if (++lines >= page_height) { diff --git a/util-linux/more.c b/util-linux/more.c index 8ae2661..9f07633 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -184,12 +184,14 @@ extern int more_main(int argc, char **argv) /* Adjust the terminal height for any overlap, so that * no lines get lost off the top. */ if (len >= terminal_width) { - div_t result = div( len, terminal_width); - if (result.quot) { - if (result.rem) - page_height-=result.quot; + int quot, rem; + quot = len / terminal_width; + rem = len - (quot * terminal_width); + if (quot) { + if (rem) + page_height-=quot; else - page_height-=(result.quot-1); + page_height-=(quot-1); } } if (++lines >= page_height) { |