Fix a logf bug which would trigger undefined behaviour(and probably crash) when both DEBUG, CONFIG_PLATFORM & PLATFORM_HOSTED are enable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27663 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f84cb98b37
commit
c0838068e3
1 changed files with 3 additions and 0 deletions
|
@ -212,6 +212,9 @@ void _logf(const char *fmt, ...)
|
|||
char buf[1024];
|
||||
vsnprintf(buf, sizeof buf, fmt, ap);
|
||||
DEBUGF("%s\n", buf);
|
||||
/* restart va_list otherwise the result if undefined when vuprintf is called */
|
||||
va_end(ap);
|
||||
va_start(ap, fmt);
|
||||
#endif
|
||||
|
||||
vuprintf(logf_push, NULL, fmt, ap);
|
||||
|
|
Loading…
Reference in a new issue