diff options
Diffstat (limited to 'coreutils/cksum.c')
-rw-r--r-- | coreutils/cksum.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/cksum.c b/coreutils/cksum.c index ac0b0c319..d8351e7c6 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 | ||
@@ -42,8 +43,9 @@ int cksum_main(int argc UNUSED_PARAM, char **argv) | |||
42 | crc = 0; | 43 | crc = 0; |
43 | length = 0; | 44 | length = 0; |
44 | 45 | ||
45 | #define read_buf bb_common_bufsiz1 | 46 | #define read_buf bb_common_bufsiz1 |
46 | while ((bytes_read = safe_read(fd, read_buf, sizeof(read_buf))) > 0) { | 47 | #define sizeof_read_buf COMMON_BUFSIZE |
48 | while ((bytes_read = safe_read(fd, read_buf, sizeof_read_buf)) > 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 | } |