From 2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Sun, 15 Apr 2007 02:59:34 +0000 Subject: * Make the WPS parser close open conditionals on new sublines and comments as well as new lines. * Make the displaying code check for invalid conditional constructs in order to avoid some rare cases of infinite looping. * Make the WPS parser check that it doesn't read more strings than it can. * Increase the string buffer size (from 512 to 1024, to accomodate the TextBox WPS which uses a lot of unicode characters). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13162 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/wps_debug.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'apps/gui/wps_debug.c') diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c index 96f3e57038..e7d3f4592a 100644 --- a/apps/gui/wps_debug.c +++ b/apps/gui/wps_debug.c @@ -398,13 +398,16 @@ void print_line_info(struct wps_data *data) void print_wps_strings(struct wps_data *data) { DEBUGF("Strings:\n"); - int i, len = 0; - for (i=0; i < data->num_strings; i++) + int i, len = 0, buf_used = 0; + for (i = 0; i < data->num_strings; i++) { len += strlen(data->strings[i]); - DEBUGF("%2d: '%s'\n", i, data->strings[i]); + buf_used += strlen(data->strings[i]) + 1; + DEBUGF("%2d: (%2d) '%s'\n", i, strlen(data->strings[i]), data->strings[i]); } - DEBUGF("Total length: %d\n", len); + DEBUGF("\n"); + DEBUGF("Total string length: %d\n", len); + DEBUGF("String buffer used: %d out of %d bytes\n", buf_used, STRING_BUFFER_SIZE); DEBUGF("\n"); } @@ -413,7 +416,7 @@ void print_img_cond_indexes(struct wps_data *data) { DEBUGF("Image conditional indexes:\n"); int i; - for (i=0; i < MAX_IMAGES; i++) + for (i = 0; i < MAX_IMAGES; i++) { if (data->img[i].cond_index) DEBUGF("%2d: %d\n", i, data->img[i].cond_index); -- cgit v1.2.3