summaryrefslogtreecommitdiff
path: root/miscutils/last.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-25 01:14:14 +0000
committerDenis Vlasenko2008-05-25 01:14:14 +0000
commit30f892a0ee32ec556467e9f7bc7c46d4ed42f12e (patch)
treeb0cade901552b736374fc60e975e902fe61b9a5f /miscutils/last.c
parent69dc3253972cbf6169abcaaef5fc7bc787a40075 (diff)
downloadbusybox-30f892a0ee32ec556467e9f7bc7c46d4ed42f12e.zip
busybox-30f892a0ee32ec556467e9f7bc7c46d4ed42f12e.tar.gz
last: code shrink
function old new delta show_entry 319 311 -8 last_main 917 907 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-18) Total: -18 bytes
Diffstat (limited to 'miscutils/last.c')
-rw-r--r--miscutils/last.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/miscutils/last.c b/miscutils/last.c
index f254118..a84e776 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -118,9 +118,10 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
printf("%-10s %-14s %-18s %-12.12s\n",
ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4);
next:
- if (!pos)
+ pos -= sizeof(ut);
+ if (pos <= 0)
break; /* done. */
- pos = lseek(file, pos - sizeof(ut), SEEK_SET);
+ xlseek(file, pos, SEEK_SET);
}
fflush_stdout_and_exit(EXIT_SUCCESS);