diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-16 18:53:34 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-16 18:53:34 +0000 |
commit | 0b4a7e382a8ca63b1c53682098a5631bc4ad4b9d (patch) | |
tree | 62dfc4e9bbfa13b87606af98adfeffb3b9705dd3 /util-linux | |
parent | 607eaf213b3d2b843977b0b2775682221bd144e0 (diff) | |
download | busybox-w32-0b4a7e382a8ca63b1c53682098a5631bc4ad4b9d.tar.gz busybox-w32-0b4a7e382a8ca63b1c53682098a5631bc4ad4b9d.tar.bz2 busybox-w32-0b4a7e382a8ca63b1c53682098a5631bc4ad4b9d.zip |
Remove/replace the "div" call.
git-svn-id: svn://busybox.net/trunk/busybox@2657 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/more.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/util-linux/more.c b/util-linux/more.c index 8ae2661ab..9f07633c3 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -184,12 +184,14 @@ extern int more_main(int argc, char **argv) | |||
184 | /* Adjust the terminal height for any overlap, so that | 184 | /* Adjust the terminal height for any overlap, so that |
185 | * no lines get lost off the top. */ | 185 | * no lines get lost off the top. */ |
186 | if (len >= terminal_width) { | 186 | if (len >= terminal_width) { |
187 | div_t result = div( len, terminal_width); | 187 | int quot, rem; |
188 | if (result.quot) { | 188 | quot = len / terminal_width; |
189 | if (result.rem) | 189 | rem = len - (quot * terminal_width); |
190 | page_height-=result.quot; | 190 | if (quot) { |
191 | if (rem) | ||
192 | page_height-=quot; | ||
191 | else | 193 | else |
192 | page_height-=(result.quot-1); | 194 | page_height-=(quot-1); |
193 | } | 195 | } |
194 | } | 196 | } |
195 | if (++lines >= page_height) { | 197 | if (++lines >= page_height) { |