Dmitry V. Levin de484eced5 Introduce print_quoted_cstring
In many places where kernel expects a NUL-terminated string of length
up to a known fixed limit, e.g. when a NUL-terminated string is
a fixed-size field of a structure, strace does not print the last byte
assuming it is NUL, which is not always the case.

Change output format for such strings to distinguish NUL-terminated
strings from non-NUL-terminated ones: append ellipsis to the output
when the string is not NUL-terminated.

* defs.h (print_quoted_cstring): New prototype.
* util.c (print_quoted_cstring): New function.
(printpathn): Use it instead of print_quoted_string with
QUOTE_0_TERMINATED argument.
* print_fields.h (PRINT_FIELD_CSTRING): Likewise.
* btrfs.c (btrfs_ioctl): Likewise.
* dirent.c (SYS_FUNC(getdents)): Likewise.
* dirent64.c (SYS_FUNC(getdents64)): Likewise.
* print_ifindex.c (print_ifindex): Likewise.
* sysmips.c (SYS_FUNC(sysmips)): Likewise.
* ubi.c (ubi_ioctl): Likewise.
* tests/tests.h (print_quoted_cstring): New prototype.
* tests/print_quoted_string.c (print_quoted_cstring): New function.
* tests/ioctl_block.c (main): Update expected output.
* tests/ioctl_dm.c (main): Likewise.
* tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise.
* tests/netlink_crypto.c (test_crypto_msg_newalg): Likewise.
2017-07-24 12:10:54 +00:00
..
2017-03-31 23:25:32 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-02-17 00:05:00 +00:00
2017-06-17 22:54:08 +00:00
2016-10-29 02:54:01 +03:00
2016-09-10 22:58:40 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-04-21 19:49:03 +00:00
2017-05-22 17:33:51 +00:00
2016-03-12 23:52:52 +00:00
2016-03-12 23:52:52 +00:00
2016-03-12 23:52:52 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-12 15:47:39 +00:00
2017-06-17 22:54:08 +00:00
2016-10-30 22:54:27 +00:00
2016-10-30 22:54:27 +00:00
2016-10-30 22:54:27 +00:00
2016-10-30 22:54:27 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2016-09-20 00:23:10 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2016-01-05 23:17:07 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-04-11 04:04:37 +00:00
2017-04-11 04:04:37 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2016-04-21 17:31:05 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-07-19 08:59:50 +00:00
2017-07-24 12:10:54 +00:00
2017-07-24 12:10:54 +00:00
2017-07-24 12:10:54 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2016-09-13 17:21:20 +00:00
2017-06-17 22:54:08 +00:00
2015-08-28 08:46:23 +00:00
2015-08-28 08:46:23 +00:00
2017-06-17 22:54:08 +00:00
2016-09-13 17:21:20 +00:00
2017-04-03 16:24:28 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2015-12-10 02:06:25 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-04-27 23:16:33 +00:00
2017-01-12 22:46:28 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-07-02 00:11:31 +00:00
2016-05-25 00:11:37 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2016-05-11 12:26:00 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2016-09-05 15:58:35 +00:00
2016-01-06 11:33:13 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-07-02 00:11:31 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2016-11-22 01:46:07 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-07-02 00:11:31 +00:00
2017-07-02 00:11:31 +00:00
2017-07-02 00:11:31 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-07-02 00:11:31 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-07-02 00:11:31 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-04-21 19:49:03 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-07-19 02:38:37 +00:00
2017-04-21 19:49:03 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2016-09-13 17:21:20 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-21 14:37:48 +00:00
2017-05-22 17:33:51 +00:00
2016-10-30 22:54:27 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2016-11-28 16:57:30 +00:00
2017-05-22 17:33:51 +00:00
2017-07-21 02:49:24 +00:00
2017-05-22 17:33:51 +00:00
2016-12-01 00:05:09 +00:00
2017-05-22 17:33:51 +00:00
2017-07-24 12:10:54 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-06-17 22:54:08 +00:00
2017-04-25 14:35:47 +00:00
2017-04-21 19:49:03 +00:00
2017-06-17 18:49:58 +00:00
2016-07-28 00:06:46 +00:00
2017-05-22 17:33:51 +00:00
2016-01-05 23:24:50 +00:00
2016-01-05 23:24:36 +00:00
2017-03-16 13:46:36 +00:00
2017-05-22 17:33:51 +00:00
2017-04-17 00:17:00 +00:00
2016-09-05 15:58:35 +00:00
2017-07-02 00:11:31 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-05-22 17:33:51 +00:00
2017-06-17 22:54:08 +00:00