diff options
author | Daniel Gustafsson <daniel@yesql.se> | 2018-11-03 20:54:18 +0100 |
---|---|---|
committer | Daniel Gustafsson <daniel@yesql.se> | 2018-11-03 20:54:18 +0100 |
commit | c37b66aaaed0a36bcb1b19596e897d7ac6219611 (patch) | |
tree | ba305dc3d11d1e3b07ca699d19c88f1a95e0c2ab /tests/data | |
parent | d82a17ad850914fee6dd17aadf9c5f902cda599f (diff) |
infof: clearly indicate truncation
The internal buffer in infof() is limited to 2048 bytes of payload plus
an additional byte for NULL termination. Servers with very long error
messages can however cause truncation of the string, which currently
isn't very clear, and leads to badly formatted output.
This appends a "...\n" (or just "..." in case the format didn't with a
newline char) marker to the end of the string to clearly show
that it has been truncated.
Also include a unittest covering infof() to try and catch any bugs
introduced in this quite important function.
Closes #3216
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/Makefile.inc | 2 | ||||
-rw-r--r-- | tests/data/test1652 | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 82aeb88be..4611d3cb8 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -184,7 +184,7 @@ test1590 \ test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \ test1608 test1609 test1620 \ \ -test1650 test1651 \ +test1650 test1651 test1652 \ \ test1700 test1701 test1702 \ \ diff --git a/tests/data/test1652 b/tests/data/test1652 new file mode 100644 index 000000000..c41169019 --- /dev/null +++ b/tests/data/test1652 @@ -0,0 +1,23 @@ +<testcase> +<info> +<keywords> +unittest +infof +</keywords> +</info> + +<client> +<server> +none +</server> +<features> +unittest +</features> +<name> +infof +</name> +<tool> +unit1652 +</tool> +</client> +</testcase> |