case 'V':
v = va_arg (args, rspamd_fstring_t *);
+ slen = v->len;
+
+ if (G_UNLIKELY (width != 0)) {
+ slen = MIN (v->len, width);
+ }
+
if (v) {
- RSPAMD_PRINTF_APPEND (v->str, v->len);
+ RSPAMD_PRINTF_APPEND (v->str, slen);
}
else {
RSPAMD_PRINTF_APPEND ("(NULL)", 6);
case 'T':
tok = va_arg (args, rspamd_ftok_t *);
+ slen = tok->len;
+
+ if (G_UNLIKELY (width != 0)) {
+ slen = MIN (tok->len, width);
+ }
+
if (tok) {
- RSPAMD_PRINTF_APPEND (tok->begin, tok->len);
+ RSPAMD_PRINTF_APPEND (tok->begin, slen);
}
else {
RSPAMD_PRINTF_APPEND ("(NULL)", 6);
case 'v':
gs = va_arg (args, GString *);
+ slen = gs->len;
+
+ if (G_UNLIKELY (width != 0)) {
+ slen = MIN (gs->len, width);
+ }
if (gs) {
- RSPAMD_PRINTF_APPEND (gs->str, gs->len);
+ RSPAMD_PRINTF_APPEND (gs->str, slen);
}
else {
RSPAMD_PRINTF_APPEND ("(NULL)", 6);
slen = strlen (p);
}
+ if (G_UNLIKELY (width != 0)) {
+ slen = MIN (slen, width);
+ }
+
if (G_LIKELY(hex == 0)) {
RSPAMD_PRINTF_APPEND (p, slen);
}