summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-11-13 00:43:43 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-11-13 01:14:49 -0500
commita634557a881b59b8be1dc156f9822c6d20bd8741 (patch)
treefd953a0ea1d9a02a8d73a15f1aead27b59c5ffaa /apps/gui
parentffe2df2e92cbdeb507a49279a85ac88cac2fbe4f (diff)
downloadrockbox-a634557a881b59b8be1dc156f9822c6d20bd8741.tar.gz
rockbox-a634557a881b59b8be1dc156f9822c6d20bd8741.zip
fix strptokspn, add strcspn, fix splash.c
fix off by 1 error in strptokspn, add strcspn, fix fallout in splash.c Change-Id: I61475d9633fc35db5a8ae30cbe588f69f2f7fabc
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/splash.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index 65c3ad8c13..d0f1fbb67c 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -73,11 +73,11 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
73 if (!next) 73 if (!next)
74 return false; /* nothing to display */ 74 return false; /* nothing to display */
75 75
76 lines[line].len = next_len + 1; 76 lines[line].len = next_len;
77 lines[line].str = next; 77 lines[line].str = next;
78 while (true) 78 while (true)
79 { 79 {
80 w = font_getstringnsize(next, next_len + 1, NULL, NULL, fontnum); 80 w = font_getstringnsize(next, next_len, NULL, NULL, fontnum);
81 if (lastbreak) 81 if (lastbreak)
82 { 82 {
83 len = next - lastbreak; 83 len = next - lastbreak;
@@ -90,18 +90,19 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
90 break; /* screen full or out of lines */ 90 break; /* screen full or out of lines */
91 x = 0; 91 x = 0;
92 y += chr_h; 92 y += chr_h;
93 lines[++line].len = next_len + len; 93 lines[++line].len = next_len;
94 lines[line].str = next; 94 lines[line].str = next;
95 } 95 }
96 else 96 else
97 { 97 {
98 /* restore & calculate spacing */ 98 /* restore & calculate spacing */
99 lines[line].len += next_len + len + 1; 99 lines[line].len += next_len + 1;
100 x += next_w; 100 x += next_w;
101 } 101 }
102 } 102 }
103 x += w; 103 x += w;
104 lastbreak = next + next_len + 1; 104
105 lastbreak = next + next_len;
105 lastbrkchr = *lastbreak; 106 lastbrkchr = *lastbreak;
106 107
107 next = strptokspn_r(NULL, matchstr, &next_len, &store); 108 next = strptokspn_r(NULL, matchstr, &next_len, &store);