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:
Amaury Pouly 2010-08-02 09:10:35 +00:00
parent f84cb98b37
commit c0838068e3

View file

@ -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);