1
0
Fork 0
forked from len0rd/rockbox

puzzles: clean up error messages

Expands buffer size, and prints to LOGF.

Change-Id: I6dbcf60152d69c928270023c550976b802269d95
This commit is contained in:
Franklin Wei 2020-06-25 16:33:19 -04:00
parent b67d9e9217
commit d75131569c
2 changed files with 6 additions and 4 deletions

View file

@ -8,6 +8,6 @@
#define assert(p) ((void)0)
#else
#define assert(e) ((e) ? (void)0 : fatal("assertion failed %s:%d", __FILE__, __LINE__))
#define assert(e) ((e) ? (void)0 : fatal("assertion failed on %s line %d: " #e, __FILE__, __LINE__))
#endif /* NDEBUG */

View file

@ -1448,15 +1448,17 @@ const drawing_api rb_drawing = {
void fatal(const char *fmt, ...)
{
va_list ap;
char buf[256];
rb->splash(HZ, "FATAL");
va_start(ap, fmt);
char buf[80];
rb->vsnprintf(buf, 80, fmt, ap);
rb->splash(HZ * 2, buf);
rb->vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
LOGF("%s", buf);
rb->splash(HZ * 2, buf);
if(rb->thread_self() == thread)
rb->thread_exit();
else