diff options
-rw-r--r-- | apps/playlist.c | 7 | ||||
-rw-r--r-- | apps/tree.c | 2 |
2 files changed, 5 insertions, 4 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) | |||
416 | */ | 416 | */ |
417 | static int recreate_control(struct playlist_info* playlist) | 417 | static int recreate_control(struct playlist_info* playlist) |
418 | { | 418 | { |
419 | char temp_file[MAX_PATH+1]; | 419 | const char file_suffix[] = "_temp\0"; |
420 | char temp_file[MAX_PATH + sizeof(file_suffix)]; | ||
420 | int temp_fd = -1; | 421 | int temp_fd = -1; |
421 | int i; | 422 | int i; |
422 | int result = 0; | 423 | int result = 0; |
@@ -432,8 +433,8 @@ static int recreate_control(struct playlist_info* playlist) | |||
432 | close(playlist->control_fd); | 433 | close(playlist->control_fd); |
433 | playlist->control_fd = 0; | 434 | playlist->control_fd = 0; |
434 | 435 | ||
435 | snprintf(temp_file, sizeof(temp_file), "%s_temp", | 436 | snprintf(temp_file, sizeof(temp_file), "%s%s", |
436 | playlist->control_filename); | 437 | playlist->control_filename, file_suffix); |
437 | 438 | ||
438 | if (rename(playlist->control_filename, temp_file) < 0) | 439 | if (rename(playlist->control_filename, temp_file) < 0) |
439 | return -1; | 440 | return -1; |
diff --git a/apps/tree.c b/apps/tree.c index 8efccf5549..e03a494a54 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -908,7 +908,7 @@ static int dirbrowse(void) | |||
908 | 908 | ||
909 | bool create_playlist(void) | 909 | bool create_playlist(void) |
910 | { | 910 | { |
911 | char filename[MAX_PATH]; | 911 | char filename[MAX_PATH + 16]; /* add enough space for extension */ |
912 | 912 | ||
913 | if (tc.currdir[1]) | 913 | if (tc.currdir[1]) |
914 | snprintf(filename, sizeof filename, "%s.m3u8", tc.currdir); | 914 | snprintf(filename, sizeof filename, "%s.m3u8", tc.currdir); |