From e689f896186e088ed73b8ce0d32620684ac01bb7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 24 Mar 2015 02:05:54 +0100 Subject: log: allow escaping % patterns --- src/log.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/log.c b/src/log.c index 7d1538a..7b68f48 100644 --- a/src/log.c +++ b/src/log.c @@ -140,6 +140,10 @@ static int fastd_vsnprintf(char *buffer, size_t size, const char *format, va_lis format++; switch(*format) { + case '%': + buffer += snprintf_safe(buffer, buffer_end-buffer, "%%"); + break; + case 'i': buffer += snprintf_safe(buffer, buffer_end-buffer, "%i", va_arg(ap, int)); break; -- cgit v1.2.3