From 21e89e87865abdc7b61afcded42a2906b2f5fee7 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 27 Jan 2011 11:27:53 +0000 Subject: Add some better debug info for when checkwps erros out because of full skin buffer git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29144 a1c6a512-1295-4272-9138-f99709370657 --- lib/skin_parser/skin_buffer.c | 4 ++++ lib/skin_parser/skin_debug.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/skin_parser/skin_buffer.c b/lib/skin_parser/skin_buffer.c index 0f72f768dd..8d94c1acdb 100644 --- a/lib/skin_parser/skin_buffer.c +++ b/lib/skin_parser/skin_buffer.c @@ -25,6 +25,7 @@ #include #include "skin_buffer.h" +#include "skin_parser.h" /**************************************************************************** * @@ -103,7 +104,10 @@ void* skin_buffer_alloc(size_t size) /* 32-bit aligned */ size = (size + 3) & ~3; if (size > skin_buffer_freespace()) + { + skin_error(MEMORY_LIMIT_EXCEEDED, NULL); return NULL; + } retval = buffer_front; buffer_front += size; #elif defined(USE_HOST_MALLOC) diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c index bcf43ab5e4..52f9127f1f 100644 --- a/lib/skin_parser/skin_debug.c +++ b/lib/skin_parser/skin_debug.c @@ -56,6 +56,8 @@ void skin_error(enum skin_errorcode error, const char* cursor) switch(error) { case MEMORY_LIMIT_EXCEEDED: + error_line_start = NULL; + printf("Error: Memory limit exceeded at Line %d\n", skin_line); error_message = "Memory limit exceeded"; break; case NEWLINE_EXPECTED: -- cgit v1.2.3