summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-01-10 13:24:05 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-01-17 17:17:38 +1000
commit20def57632583aef095ca18792c7fce16d2d9004 (patch)
treeed6b176395f0919ee6976168f2109b59041299f7 /os
parentf53b2012f39085d866f267dda1442a48ace3c5a5 (diff)
os: silently ignore length modifiers in pnprintf
Until we have support for them, ignore any length modifiers so we don't need to update all callers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os')
-rw-r--r--os/log.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/os/log.c b/os/log.c
index 4820e9a77..213906420 100644
--- a/os/log.c
+++ b/os/log.c
@@ -298,7 +298,13 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
continue;
}
- switch (f[++f_idx]) {
+ f_idx++;
+
+ /* silently swallow length modifiers */
+ while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9') || f[f_idx] == '.'))
+ f_idx++;
+
+ switch (f[f_idx]) {
case 's':
string_arg = va_arg(args, char*);
p_len = strlen_sigsafe(string_arg);