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>
This commit is contained in:
parent
f53b2012f3
commit
20def57632
8
os/log.c
8
os/log.c
|
@ -298,7 +298,13 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
|
||||||
continue;
|
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':
|
case 's':
|
||||||
string_arg = va_arg(args, char*);
|
string_arg = va_arg(args, char*);
|
||||||
p_len = strlen_sigsafe(string_arg);
|
p_len = strlen_sigsafe(string_arg);
|
||||||
|
|
Loading…
Reference in New Issue