summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-03-24 02:05:54 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-03-24 02:05:54 +0100
commite689f896186e088ed73b8ce0d32620684ac01bb7 (patch)
tree13eae5039f96141f96852237aad0d51722b2bd9e
parent45d573ab617136670223de5e271f8e7398007c1c (diff)
downloadfastd-e689f896186e088ed73b8ce0d32620684ac01bb7.tar
fastd-e689f896186e088ed73b8ce0d32620684ac01bb7.zip
log: allow escaping % patterns
-rw-r--r--src/log.c4
1 files changed, 4 insertions, 0 deletions
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;