diff options
author | Jim Meyering <jim@meyering.net> | 2001-04-22 08:31:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-04-22 08:31:24 +0000 |
commit | 519b707b4efbb3711adc24ad54a43f1474c42be3 (patch) | |
tree | e561c1a73cabb759b19e8aa791ee1ebc20c93083 /man/sync.x | |
parent | 2d0f3f2e74faf9bfb2d8d6462b86d515b50366c1 (diff) | |
download | coreutils-519b707b4efbb3711adc24ad54a43f1474c42be3.tar.xz |
Fix bugs when computing length of large files.
Add overflow and write error checks. Use uint_fast32_t, not
unsigned long, to do checksum calculation, as C99 says
uint_fast32_t should be no slower and might be faster.
Include <stdio.h> and "system.h" even if CRCTAB is defined,
so that the code will compile if CRCTAB is defined.
Include "human.h" if CRCTAB is not defined.
(uint_fast32_t): Define if it appears that stdint.h didn't.
(BIT, remainder, main, crctab): Use uint_fast32_t, not unsigned long,
for checksums.
(fill_r, remainder, main): Use ANSI prototypes.
(fill_r, remainder, main): Omit duplicate code.
(main): Use uintmax_t, not unsigned long, for file lengths.
Use size_t, not long, for result of fread.
Check for overflow when computing file lengths.
Check for write error immediately after printing a line, so that
we don't write to stdout indefinitely after an error.
Diffstat (limited to 'man/sync.x')
0 files changed, 0 insertions, 0 deletions