forked from len0rd/rockbox
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:
parent
72f93e5f10
commit
3ad3bec0ad
1 changed files with 1 additions and 2 deletions
|
@ -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->style = style;
|
||||
|
||||
memset(s->line, 0, sizeof s->line);
|
||||
strcpy(s->line, string);
|
||||
strlcpy(s->line, string, sizeof s->line);
|
||||
|
||||
/* get width */
|
||||
s->width = LCDFN(getstringsize)(s->line, &w, &h);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue