diff options
author | Franklin Wei <franklin@rockbox.org> | 2020-06-25 16:33:19 -0400 |
---|---|---|
committer | Franklin Wei <franklin@rockbox.org> | 2020-06-25 16:46:03 -0400 |
commit | d75131569cb74faa2a75eb94b1a81e8c0fe7bb7f (patch) | |
tree | d75ae898a5182da6996de3cbcd2dcd1318f3fd66 /apps | |
parent | b67d9e9217351c903a9d1ac571db698e362f3d18 (diff) |
puzzles: clean up error messages
Expands buffer size, and prints to LOGF.
Change-Id: I6dbcf60152d69c928270023c550976b802269d95
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/puzzles/rbassert.h | 2 | ||||
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/plugins/puzzles/rbassert.h b/apps/plugins/puzzles/rbassert.h index f3fef84351..56142d633b 100644 --- a/apps/plugins/puzzles/rbassert.h +++ b/apps/plugins/puzzles/rbassert.h @@ -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 */ diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index ac6388bf4d..1aee42d080 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c @@ -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 |