summaryrefslogtreecommitdiffstats
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,
if (!next)
return false; /* nothing to display */
- lines[line].len = next_len + 1;
+ lines[line].len = next_len;
lines[line].str = next;
while (true)
{
- w = font_getstringnsize(next, next_len + 1, NULL, NULL, fontnum);
+ w = font_getstringnsize(next, next_len, NULL, NULL, fontnum);
if (lastbreak)
{
len = next - lastbreak;
@@ -90,18 +90,19 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
break; /* screen full or out of lines */
x = 0;
y += chr_h;
- lines[++line].len = next_len + len;
+ lines[++line].len = next_len;
lines[line].str = next;
}
else
{
/* restore & calculate spacing */
- lines[line].len += next_len + len + 1;
+ lines[line].len += next_len + 1;
x += next_w;
}
}
x += w;
- lastbreak = next + next_len + 1;
+
+ lastbreak = next + next_len;
lastbrkchr = *lastbreak;
next = strptokspn_r(NULL, matchstr, &next_len, &store);