Jim Meyering
519b707b4e
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.
2001-04-22 08:31:24 +00:00
..
1999-04-13 14:44:33 +00:00
1998-06-29 15:57:45 +00:00
2000-05-07 14:49:06 +00:00
2000-10-21 19:57:41 +00:00
2000-11-26 23:10:55 +00:00
2001-01-07 09:21:34 +00:00
2000-11-23 15:04:17 +00:00
2000-12-16 18:52:58 +00:00
2000-12-16 18:47:43 +00:00
2001-02-17 14:23:43 +00:00
2000-05-07 14:49:06 +00:00
2001-04-22 08:31:24 +00:00
2000-08-19 11:09:03 +00:00
2001-01-13 15:50:01 +00:00
2001-01-14 11:04:47 +00:00
2001-01-10 11:54:53 +00:00
1998-04-06 08:14:58 +00:00
2001-02-03 16:50:34 +00:00
2000-08-05 08:34:25 +00:00
2000-09-07 07:08:17 +00:00
2001-03-09 18:28:33 +00:00
1998-02-06 20:48:10 +00:00
2001-04-22 07:28:58 +00:00
2000-11-23 15:36:58 +00:00
2000-08-08 07:11:12 +00:00
2000-04-08 19:04:00 +00:00
2001-01-28 21:58:19 +00:00
2000-11-18 20:01:02 +00:00
2000-05-07 14:51:07 +00:00
2000-05-07 14:51:49 +00:00
2000-05-20 22:06:38 +00:00
2000-05-07 14:52:16 +00:00
2001-02-04 16:28:41 +00:00
2001-03-12 21:16:05 +00:00
2000-08-07 13:19:52 +00:00
2000-05-12 22:38:58 +00:00
2000-08-07 13:27:24 +00:00
2000-05-07 14:53:15 +00:00
2000-05-07 14:53:15 +00:00
2000-12-02 22:16:41 +00:00
2000-12-25 11:07:20 +00:00
2000-11-18 13:10:40 +00:00
2001-02-03 20:22:58 +00:00
2000-05-07 14:55:15 +00:00
2001-04-21 09:47:39 +00:00
2000-11-26 23:12:44 +00:00
2000-10-22 11:50:16 +00:00
2001-02-21 10:56:06 +00:00
2000-09-30 09:40:56 +00:00
2000-09-30 08:53:27 +00:00
2001-02-03 16:50:04 +00:00
2000-05-07 14:55:15 +00:00
2000-05-20 22:06:38 +00:00
2000-05-12 22:38:58 +00:00
2001-01-02 15:48:21 +00:00
2000-05-20 22:06:38 +00:00
2000-05-07 14:55:15 +00:00
2000-11-17 08:31:01 +00:00
2001-03-17 08:48:23 +00:00
2000-05-11 07:24:05 +00:00
2000-05-07 14:57:24 +00:00
2000-05-20 22:06:38 +00:00
2000-05-07 14:57:52 +00:00
2001-02-18 16:24:21 +00:00
2000-10-16 08:10:58 +00:00
2000-05-13 06:49:53 +00:00
2000-07-30 16:34:48 +00:00
2000-12-02 22:18:21 +00:00
2000-11-26 23:13:11 +00:00
2001-01-17 10:29:56 +00:00
2000-05-11 07:21:33 +00:00
2001-04-15 05:58:33 +00:00
1998-06-29 16:24:01 +00:00
2000-05-20 22:06:38 +00:00
2000-07-17 20:07:33 +00:00
2001-01-07 16:07:33 +00:00
2000-06-24 07:37:55 +00:00
2001-01-17 10:28:46 +00:00
2001-03-17 08:50:51 +00:00
2000-04-19 15:36:05 +00:00
1998-06-29 15:57:45 +00:00
2001-03-12 10:52:20 +00:00
2001-03-18 07:53:14 +00:00
2000-08-14 21:40:30 +00:00
2000-05-07 14:46:33 +00:00
2001-03-17 10:14:29 +00:00
2000-08-11 09:12:05 +00:00
2000-05-11 07:21:33 +00:00
2001-01-17 09:42:36 +00:00
2000-05-11 07:24:05 +00:00
2000-05-07 14:46:33 +00:00
2000-05-20 22:06:38 +00:00
2001-03-18 07:54:19 +00:00
2000-11-17 08:31:01 +00:00
2000-11-17 08:31:01 +00:00
2001-04-14 06:43:24 +00:00
2001-02-06 09:56:22 +00:00
2000-11-17 08:31:01 +00:00
2000-05-07 14:46:33 +00:00
2000-09-29 21:40:38 +00:00