diff options
| author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-04-15 02:59:34 +0000 |
|---|---|---|
| committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-04-15 02:59:34 +0000 |
| commit | 2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68 (patch) | |
| tree | 6967092524e64d2365034073efef820b41d31a2d /apps/gui/wps_debug.c | |
| parent | ac946416060c19eb6cfe9da3d1885baee329df30 (diff) | |
| download | rockbox-2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68.zip rockbox-2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68.tar.gz rockbox-2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68.tar.bz2 rockbox-2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68.tar.xz | |
* 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
Diffstat (limited to 'apps/gui/wps_debug.c')
| -rw-r--r-- | apps/gui/wps_debug.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c index 96f3e57..e7d3f45 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); |