diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-05-24 11:16:46 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-05-24 11:17:41 -0400 |
commit | 8825b330529a1cc1a74bb0b4f6880fbdd4333b22 (patch) | |
tree | 70a373a62f37dabf14fb9375f6a14085ebd1bf0e /lib | |
parent | 2dc6947a2db18f7566e1f6ebd0282b0412b258ac (diff) | |
download | rockbox-8825b330529a1cc1a74bb0b4f6880fbdd4333b22.tar.gz rockbox-8825b330529a1cc1a74bb0b4f6880fbdd4333b22.zip |
skin_debug: Don't segfault when dump a viewport with no children
Change-Id: I5dfcc53a735dab1552211cdf522f4d18d93e6ec8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/skin_parser/skin_debug.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c index ff26819bc0..e1746023b3 100644 --- a/lib/skin_parser/skin_debug.c +++ b/lib/skin_parser/skin_debug.c | |||
@@ -43,6 +43,9 @@ static char* error_message; | |||
43 | static inline struct skin_element* | 43 | static inline struct skin_element* |
44 | get_child(OFFSETTYPE(struct skin_element**) children, int child) | 44 | get_child(OFFSETTYPE(struct skin_element**) children, int child) |
45 | { | 45 | { |
46 | if (children == NULL) | ||
47 | return NULL; | ||
48 | |||
46 | struct skin_element **kids = SKINOFFSETTOPTR(skin_buffer, children); | 49 | struct skin_element **kids = SKINOFFSETTOPTR(skin_buffer, children); |
47 | return kids[child]; | 50 | return kids[child]; |
48 | } | 51 | } |
@@ -266,7 +269,7 @@ void skin_debug_params(int count, struct skin_tag_parameter params[]) | |||
266 | case INTEGER: | 269 | case INTEGER: |
267 | printf("integer: %d", params[i].data.number); | 270 | printf("integer: %d", params[i].data.number); |
268 | break; | 271 | break; |
269 | 272 | ||
270 | case DECIMAL: | 273 | case DECIMAL: |
271 | printf("decimal: %d.%d", params[i].data.number/10, | 274 | printf("decimal: %d.%d", params[i].data.number/10, |
272 | params[i].data.number%10); | 275 | params[i].data.number%10); |