diff options
Diffstat (limited to 'coreutils/cksum.c')
-rw-r--r-- | coreutils/cksum.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/cksum.c b/coreutils/cksum.c index ac0b0c319..8a8a39f68 100644 --- a/coreutils/cksum.c +++ b/coreutils/cksum.c | |||
@@ -13,6 +13,7 @@ | |||
13 | //usage: "Calculate the CRC32 checksums of FILES" | 13 | //usage: "Calculate the CRC32 checksums of FILES" |
14 | 14 | ||
15 | #include "libbb.h" | 15 | #include "libbb.h" |
16 | #include "common_bufsiz.h" | ||
16 | 17 | ||
17 | /* This is a NOEXEC applet. Be very careful! */ | 18 | /* This is a NOEXEC applet. Be very careful! */ |
18 | 19 | ||
@@ -32,6 +33,7 @@ int cksum_main(int argc UNUSED_PARAM, char **argv) | |||
32 | argv++; | 33 | argv++; |
33 | #endif | 34 | #endif |
34 | 35 | ||
36 | setup_common_bufsiz(); | ||
35 | do { | 37 | do { |
36 | 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); |
37 | 39 | ||
@@ -43,7 +45,7 @@ int cksum_main(int argc UNUSED_PARAM, char **argv) | |||
43 | length = 0; | 45 | length = 0; |
44 | 46 | ||
45 | #define read_buf bb_common_bufsiz1 | 47 | #define read_buf bb_common_bufsiz1 |
46 | while ((bytes_read = safe_read(fd, read_buf, sizeof(read_buf))) > 0) { | 48 | while ((bytes_read = safe_read(fd, read_buf, COMMON_BUFSIZE)) > 0) { |
47 | length += bytes_read; | 49 | length += bytes_read; |
48 | crc = crc32_block_endian1(crc, read_buf, bytes_read, crc32_table); | 50 | crc = crc32_block_endian1(crc, read_buf, bytes_read, crc32_table); |
49 | } | 51 | } |