diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-03-24 02:05:54 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-03-24 02:05:54 +0100 |
commit | e689f896186e088ed73b8ce0d32620684ac01bb7 (patch) | |
tree | 13eae5039f96141f96852237aad0d51722b2bd9e | |
parent | 45d573ab617136670223de5e271f8e7398007c1c (diff) | |
download | fastd-e689f896186e088ed73b8ce0d32620684ac01bb7.tar fastd-e689f896186e088ed73b8ce0d32620684ac01bb7.zip |
log: allow escaping % patterns
-rw-r--r-- | src/log.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |