summaryrefslogtreecommitdiffstats
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-07-25 18:33:10 +0200
committerWilliam Wilgus <me.theuser@yahoo.com>2018-07-25 18:34:53 +0200
commit2fb6b2b4588ec1e22ca1043eaa12695ade9d7bf9 (patch)
tree44c7bdaed9d7c294a2e2c46e7ff7b39d6a3ab2d0 /apps/playlist.c
parent2eeb338e906d0873c6d5386adfbaf82348edd04c (diff)
downloadrockbox-2fb6b2b4588ec1e22ca1043eaa12695ade9d7bf9.tar.gz
rockbox-2fb6b2b4588ec1e22ca1043eaa12695ade9d7bf9.tar.bz2
rockbox-2fb6b2b4588ec1e22ca1043eaa12695ade9d7bf9.zip
Fix truncation warning playlist.c, tree.c
Change-Id: I0c62f06fea3ccb55efa21b719a44a263dedc32e2
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 20bd048181..f566999212 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -416,7 +416,8 @@ static int check_control(struct playlist_info* playlist)
*/
static int recreate_control(struct playlist_info* playlist)
{
- char temp_file[MAX_PATH+1];
+ const char file_suffix[] = "_temp\0";
+ char temp_file[MAX_PATH + sizeof(file_suffix)];
int temp_fd = -1;
int i;
int result = 0;
@@ -432,8 +433,8 @@ static int recreate_control(struct playlist_info* playlist)
close(playlist->control_fd);
playlist->control_fd = 0;
- snprintf(temp_file, sizeof(temp_file), "%s_temp",
- playlist->control_filename);
+ snprintf(temp_file, sizeof(temp_file), "%s%s",
+ playlist->control_filename, file_suffix);
if (rename(playlist->control_filename, temp_file) < 0)
return -1;