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.tar.gz rockbox-2e1169bddaa424ae5eef36e2ec12e2a3cb0adc68.zip |
* 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 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) | |||
398 | void print_wps_strings(struct wps_data *data) | 398 | void print_wps_strings(struct wps_data *data) |
399 | { | 399 | { |
400 | DEBUGF("Strings:\n"); | 400 | DEBUGF("Strings:\n"); |
401 | int i, len = 0; | 401 | int i, len = 0, buf_used = 0; |
402 | for (i=0; i < data->num_strings; i++) | 402 | for (i = 0; i < data->num_strings; i++) |
403 | { | 403 | { |
404 | len += strlen(data->strings[i]); | 404 | len += strlen(data->strings[i]); |
405 | DEBUGF("%2d: '%s'\n", i, data->strings[i]); | 405 | buf_used += strlen(data->strings[i]) + 1; |
406 | DEBUGF("%2d: (%2d) '%s'\n", i, strlen(data->strings[i]), data->strings[i]); | ||
406 | } | 407 | } |
407 | DEBUGF("Total length: %d\n", len); | 408 | DEBUGF("\n"); |
409 | DEBUGF("Total string length: %d\n", len); | ||
410 | DEBUGF("String buffer used: %d out of %d bytes\n", buf_used, STRING_BUFFER_SIZE); | ||
408 | DEBUGF("\n"); | 411 | DEBUGF("\n"); |
409 | } | 412 | } |
410 | 413 | ||
@@ -413,7 +416,7 @@ void print_img_cond_indexes(struct wps_data *data) | |||
413 | { | 416 | { |
414 | DEBUGF("Image conditional indexes:\n"); | 417 | DEBUGF("Image conditional indexes:\n"); |
415 | int i; | 418 | int i; |
416 | for (i=0; i < MAX_IMAGES; i++) | 419 | for (i = 0; i < MAX_IMAGES; i++) |
417 | { | 420 | { |
418 | if (data->img[i].cond_index) | 421 | if (data->img[i].cond_index) |
419 | DEBUGF("%2d: %d\n", i, data->img[i].cond_index); | 422 | DEBUGF("%2d: %d\n", i, data->img[i].cond_index); |