Use strlcpy instead of a memset&strcpy combo. Guarantees \0-terminaltion and gives a 1-3% speed up.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23284 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-10-20 00:09:16 +00:00
parent 72f93e5f10
commit 3ad3bec0ad

View file

@ -262,8 +262,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
s->start_tick = current_tick + LCDFN(scroll_info).delay; s->start_tick = current_tick + LCDFN(scroll_info).delay;
s->style = style; s->style = style;
memset(s->line, 0, sizeof s->line); strlcpy(s->line, string, sizeof s->line);
strcpy(s->line, string);
/* get width */ /* get width */
s->width = LCDFN(getstringsize)(s->line, &w, &h); s->width = LCDFN(getstringsize)(s->line, &w, &h);