diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2022-01-18 00:31:27 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2022-01-18 00:36:42 +0100 |
commit | 1e825acf8d715fe49af040cb02f9e96c26955832 (patch) | |
tree | 1ba246aca6ab29b154dd14e61e96fafd6bab475e /coreutils | |
parent | 8ad2acf352d790d0bdd792b8e126d58a088451f3 (diff) | |
download | busybox-w32-1e825acf8d715fe49af040cb02f9e96c26955832.tar.gz busybox-w32-1e825acf8d715fe49af040cb02f9e96c26955832.tar.bz2 busybox-w32-1e825acf8d715fe49af040cb02f9e96c26955832.zip |
libbb: shrink lineedit_read_key()
function old new delta
lineedit_read_key 237 231 -6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/head.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/head.c b/coreutils/head.c index 9586f869f..c7537a20e 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
@@ -76,7 +76,7 @@ print_except_N_last_bytes(FILE *fp, unsigned count) | |||
76 | { | 76 | { |
77 | unsigned char *circle = xmalloc(++count); | 77 | unsigned char *circle = xmalloc(++count); |
78 | unsigned head = 0; | 78 | unsigned head = 0; |
79 | for(;;) { | 79 | for (;;) { |
80 | int c; | 80 | int c; |
81 | c = getc(fp); | 81 | c = getc(fp); |
82 | if (c == EOF) | 82 | if (c == EOF) |
@@ -105,7 +105,7 @@ print_except_N_last_lines(FILE *fp, unsigned count) | |||
105 | { | 105 | { |
106 | char **circle = xzalloc((++count) * sizeof(circle[0])); | 106 | char **circle = xzalloc((++count) * sizeof(circle[0])); |
107 | unsigned head = 0; | 107 | unsigned head = 0; |
108 | for(;;) { | 108 | for (;;) { |
109 | char *c; | 109 | char *c; |
110 | c = xmalloc_fgets(fp); | 110 | c = xmalloc_fgets(fp); |
111 | if (!c) | 111 | if (!c) |
@@ -127,7 +127,7 @@ print_except_N_last_lines(FILE *fp, unsigned count) | |||
127 | } | 127 | } |
128 | ret: | 128 | ret: |
129 | head = 0; | 129 | head = 0; |
130 | for(;;) { | 130 | for (;;) { |
131 | free(circle[head++]); | 131 | free(circle[head++]); |
132 | if (head == count) | 132 | if (head == count) |
133 | break; | 133 | break; |