summaryrefslogtreecommitdiff
path: root/apps/gui/gwps-common.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-07-14 13:57:45 +0000
committerNils Wallménius <nils@rockbox.org>2009-07-14 13:57:45 +0000
commit3d4701a6e41616cf581a297bab1451cf2db70249 (patch)
treef845837c96ffbed7d59ddf8308f3b3e7c40cb8c9 /apps/gui/gwps-common.c
parentc2900a1bacd5d98b57a0d15ea2add1bc08764057 (diff)
downloadrockbox-3d4701a6e41616cf581a297bab1451cf2db70249.tar.gz
rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.zip
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
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r--apps/gui/gwps-common.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index f480f616a2..c0923a9ab5 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -659,8 +659,7 @@ static char* get_dir(char* buf, int buf_size, const char* path, int level)
659 return NULL; 659 return NULL;
660 660
661 len = MIN(last_sep - sep, buf_size - 1); 661 len = MIN(last_sep - sep, buf_size - 1);
662 strncpy(buf, sep + 1, len); 662 strlcpy(buf, sep + 1, len + 1);
663 buf[len] = 0;
664 return buf; 663 return buf;
665} 664}
666 665
@@ -1183,12 +1182,12 @@ static const char *get_token_value(struct gui_wps *gwps,
1183 { 1182 {
1184 /* we need 11 characters (full line) for 1183 /* we need 11 characters (full line) for
1185 progress-bar */ 1184 progress-bar */
1186 strncpy(buf, " ", buf_size); 1185 strlcpy(buf, " ", buf_size);
1187 } 1186 }
1188 else 1187 else
1189 { 1188 {
1190 /* Tell the user if we have an OldPlayer */ 1189 /* Tell the user if we have an OldPlayer */
1191 strncpy(buf, " <Old LCD> ", buf_size); 1190 strlcpy(buf, " <Old LCD> ", buf_size);
1192 } 1191 }
1193 return buf; 1192 return buf;
1194#endif 1193#endif
@@ -1254,11 +1253,11 @@ static const char *get_token_value(struct gui_wps *gwps,
1254 break; 1253 break;
1255 case 2: 1254 case 2:
1256 case 4: 1255 case 4:
1257 strncpy(buf, id3->track_gain_string, buf_size); 1256 strlcpy(buf, id3->track_gain_string, buf_size);
1258 break; 1257 break;
1259 case 3: 1258 case 3:
1260 case 5: 1259 case 5:
1261 strncpy(buf, id3->album_gain_string, buf_size); 1260 strlcpy(buf, id3->album_gain_string, buf_size);
1262 break; 1261 break;
1263 } 1262 }
1264 return buf; 1263 return buf;