Paul Eggert
6568b173db
csplit: do not rely on undefined behavior in printf formats
...
* doc/coreutils.texi (csplit invocation): Say that %d and %i are
aliases for %u.
* src/csplit.c (FLAG_THOUSANDS, FLAG_ALTERNATIVE): New constants.
(get_format_flags): Now take char const * and int * and return
size_t. It now stores info about the flags instead of merely
scanning them. Also, it handles '0' correctly. Drop support for
the undocumented '+' and ' ' flags since the value is unsigned.
Add support for the (undocumented) "'" flag. All uses changed.
(get_format_width, get_format_prec): Remove.
(check_format_conv_type): Renamed from get_format_conv_type, with
a different signature. It now converts the format to one that is
compatible with unsigned int, and checks flags. All uses changed.
(max_out): Have snprintf compute the number of bytes needed rather
than attempting to do it ourselves (which doesn't work portably
with outlandish formats such as %4294967296d).
(check_format_conv_type, main): Check for overflow in size
calculations. Don't assume size_t fits in unsigned int.
* tests/misc/csplit: Check for proper handling of flags, with
%0#6.3x. Coreutils 8.6 mishandles this somewhat-weird example.
2010-11-11 08:16:24 +01:00
..
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-07-05 15:06:07 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:48 +01:00
2010-01-01 14:06:48 +01:00
2010-01-01 14:06:47 +01:00
2010-03-26 14:31:16 +00:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-11-11 08:16:24 +01:00
2010-11-10 22:08:05 +01:00
2010-11-11 01:40:12 +00:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-09-07 17:33:16 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-02-25 08:54:49 -07:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-26 11:33:53 +02:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-09-07 10:49:55 +01:00
2010-10-14 09:23:51 +02:00
2010-10-26 18:14:50 +02:00
2010-10-19 09:35:44 +02:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-23 18:10:41 +02:00
2010-01-01 14:06:47 +01:00
2010-03-26 14:31:16 +00:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:48 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-08-13 15:57:52 -07:00
2010-10-01 15:43:23 -06:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-09-20 15:23:20 +01:00
2010-05-24 12:12:24 +01:00
2010-01-01 14:06:47 +01:00
2010-10-17 09:18:57 +02:00
2010-05-31 10:59:11 +02:00
2010-07-23 23:44:25 -07:00
2010-05-25 12:32:03 +02:00
2010-01-01 14:06:47 +01:00
2010-10-01 15:43:23 -06:00
2010-01-13 10:21:02 +01:00
2010-01-01 14:06:47 +01:00
2010-10-07 20:08:16 +01:00
2010-01-01 14:06:47 +01:00
2010-10-04 16:54:22 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-10-01 15:43:23 -06:00
2010-11-06 18:09:44 -07:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-07-05 15:06:07 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-08-28 19:28:20 +02:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-31 10:59:11 +02:00
2010-01-01 14:06:47 +01:00
2010-03-16 23:10:15 +00:00
2010-03-26 14:27:54 +00:00
2010-09-29 11:05:12 +01:00
2010-10-01 15:43:23 -06:00
2010-01-01 14:06:47 +01:00
2010-05-29 10:45:13 +01:00
2010-01-01 14:06:47 +01:00
2010-05-29 10:45:13 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-28 14:23:04 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-31 10:59:11 +02:00
2010-05-31 10:59:11 +02:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-03-29 08:28:51 +02:00
2010-01-01 14:06:47 +01:00