From 3d4701a6e41616cf581a297bab1451cf2db70249 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 14 Jul 2009 13:57:45 +0000 Subject: FS#10080 * Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/buttonbar.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/gui/buttonbar.c') diff --git a/apps/gui/buttonbar.c b/apps/gui/buttonbar.c index abf1800bb2..3c343f09ac 100644 --- a/apps/gui/buttonbar.c +++ b/apps/gui/buttonbar.c @@ -86,18 +86,15 @@ void gui_buttonbar_set(struct gui_buttonbar * buttonbar, gui_buttonbar_unset(buttonbar); if(caption1) { - strncpy(buttonbar->caption[0], caption1, 7); - buttonbar->caption[0][7] = 0; + strlcpy(buttonbar->caption[0], caption1, BUTTONBAR_CAPTION_LENGTH); } if(caption2) { - strncpy(buttonbar->caption[1], caption2, 7); - buttonbar->caption[1][7] = 0; + strlcpy(buttonbar->caption[1], caption2, BUTTONBAR_CAPTION_LENGTH); } if(caption3) { - strncpy(buttonbar->caption[2], caption3, 7); - buttonbar->caption[2][7] = 0; + strlcpy(buttonbar->caption[2], caption3, BUTTONBAR_CAPTION_LENGTH); } } -- cgit v1.2.3