diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-20 13:34:51 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-22 10:25:05 +0200 |
commit | c4e5d2f9bdb6065ab381bdd84a03382eaa8b700e (patch) | |
tree | 38cbb8b3dea1b758a055a401d7bbe9c4dd5f7ac2 /include/mysql/service_my_snprintf.h | |
parent | e380f447421882d8a0700e8821e55e2786b426ad (diff) | |
download | mariadb-git-bb-10.2-MDEV-22545.tar.gz |
MDEV-22545: my_vsnprintf behaves not as in C standardbb-10.2-MDEV-22545
Added parameter %T for string which should be visibly truncated.
Diffstat (limited to 'include/mysql/service_my_snprintf.h')
-rw-r--r-- | include/mysql/service_my_snprintf.h | 6 |
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 |