summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-05-20 13:34:51 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2020-05-24 21:27:08 +0200
commitcf52dd174ecf0e6055f4443be9c1fea8bc37b65e (patch)
tree63eba68da735d7d8280e624ae1be9a3d3f78588b /include
parentd8e2fa0c49d506bde037fe448dc9840e8e14cf92 (diff)
downloadmariadb-git-cf52dd174ecf0e6055f4443be9c1fea8bc37b65e.tar.gz
MDEV-22545: my_vsnprintf behaves not as in C standard
Added parameter %T for string which should be visibly truncated.
Diffstat (limited to 'include')
-rw-r--r--include/mysql/service_my_snprintf.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h
index bd1f069c527..6757a658fb6 100644
--- a/include/mysql/service_my_snprintf.h
+++ b/include/mysql/service_my_snprintf.h
@@ -55,7 +55,8 @@
Supported formats are 's' (null pointer is accepted, printed as
"(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
- 'X', 'p' (works as 0x%x), 'f', 'g', 'M' (extension, see below).
+ 'X', 'p' (works as 0x%x), 'f', 'g', 'M' (extension, see below),
+ 'T' (extension, see below).
Standard syntax for positional arguments $n is supported.
@@ -69,6 +70,9 @@
Format 'M': takes one integer, prints this integer, space, double quote
error message, double quote. In other words
printf("%M", n) === printf("%d \"%s\"", n, strerror(n))
+
+ Format 'T': takes string and print it like s but if the strints should be
+ truncated puts "..." at the end.
*/
#ifdef __cplusplus