aboutsummaryrefslogtreecommitdiff
path: root/coreutils/cksum.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-04-21 18:38:51 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-04-21 18:38:51 +0200
commit9de2e5a22213842da5b116723392de88de9ed419 (patch)
treedff999a566382174e084d377dc3b4c03de1d4c62 /coreutils/cksum.c
parent47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 (diff)
downloadbusybox-w32-9de2e5a22213842da5b116723392de88de9ed419.tar.gz
busybox-w32-9de2e5a22213842da5b116723392de88de9ed419.tar.bz2
busybox-w32-9de2e5a22213842da5b116723392de88de9ed419.zip
*: hopefully all setup_common_bufsiz() are in place
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/cksum.c')
-rw-r--r--coreutils/cksum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/cksum.c b/coreutils/cksum.c
index d8351e7c6..8a8a39f68 100644
--- a/coreutils/cksum.c
+++ b/coreutils/cksum.c
@@ -33,6 +33,7 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
33 argv++; 33 argv++;
34#endif 34#endif
35 35
36 setup_common_bufsiz();
36 do { 37 do {
37 int fd = open_or_warn_stdin(*argv ? *argv : bb_msg_standard_input); 38 int fd = open_or_warn_stdin(*argv ? *argv : bb_msg_standard_input);
38 39
@@ -43,9 +44,8 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
43 crc = 0; 44 crc = 0;
44 length = 0; 45 length = 0;
45 46
46#define read_buf bb_common_bufsiz1 47#define read_buf bb_common_bufsiz1
47#define sizeof_read_buf COMMON_BUFSIZE 48 while ((bytes_read = safe_read(fd, read_buf, COMMON_BUFSIZE)) > 0) {
48 while ((bytes_read = safe_read(fd, read_buf, sizeof_read_buf)) > 0) {
49 length += bytes_read; 49 length += bytes_read;
50 crc = crc32_block_endian1(crc, read_buf, bytes_read, crc32_table); 50 crc = crc32_block_endian1(crc, read_buf, bytes_read, crc32_table);
51 } 51 }