summaryrefslogtreecommitdiffstats
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-09-24 20:03:53 +0000
committerNils Wallménius <nils@rockbox.org>2008-09-24 20:03:53 +0000
commit93a87685c3f39e731f4297b07bd139420b2e5554 (patch)
tree6ef4cd5f3b2b1a770ea1102cc6ce5d12f508e2e2 /apps/playlist.c
parent7d4cebd7dad4d1e5e97084c28a0f71d4d7142295 (diff)
downloadrockbox-93a87685c3f39e731f4297b07bd139420b2e5554.tar.gz
rockbox-93a87685c3f39e731f4297b07bd139420b2e5554.zip
Clean up use of snprintf where strncpy if suited, avoid useless copying of constant strings for wps token evaluator, minor const police too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18625 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 5d8d8495bf..8dd444889a 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -1894,8 +1894,8 @@ void playlist_init(void)
struct playlist_info* playlist = &current_playlist;
playlist->current = true;
- snprintf(playlist->control_filename, sizeof(playlist->control_filename),
- "%s", PLAYLIST_CONTROL_FILE);
+ strncpy(playlist->control_filename, PLAYLIST_CONTROL_FILE,
+ sizeof(playlist->control_filename));
playlist->fd = -1;
playlist->control_fd = -1;
playlist->max_playlist_size = global_settings.max_files_in_playlist;
@@ -3230,7 +3230,7 @@ char *playlist_name(const struct playlist_info* playlist, char *buf,
if (!playlist)
playlist = &current_playlist;
- snprintf(buf, buf_size, "%s", playlist->filename+playlist->dirlen);
+ strncpy(buf, playlist->filename+playlist->dirlen, buf_size);
if (!buf[0])
return NULL;
@@ -3250,7 +3250,7 @@ char *playlist_get_name(const struct playlist_info* playlist, char *buf,
if (!playlist)
playlist = &current_playlist;
- snprintf(buf, buf_size, "%s", playlist->filename);
+ strncpy(buf, playlist->filename, buf_size);
if (!buf[0])
return NULL;