summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-08-06 19:37:13 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-08-06 19:38:06 +0100
commit257ba1d2e0d8048c488459762b2bca033815767f (patch)
tree46d4a054dd4ed6fe3e60ad72b78655bf40e5dc6d /apps/playlist.c
parent02b940396bb1fcb535e20dd5b5ada21ed7ce0ea7 (diff)
downloadrockbox-257ba1d2e0d8048c488459762b2bca033815767f.tar.gz
rockbox-257ba1d2e0d8048c488459762b2bca033815767f.zip
Fix possible negative fd in playlist.c
Change-Id: I59d88609ec3f20ec9f482a777396cd72be23a35b
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 2e28fc859d..49c52a9b7e 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -3707,7 +3707,7 @@ int playlist_save(struct playlist_info* playlist, char *filename,
3707 if (!rename(path, tmp_buf)) 3707 if (!rename(path, tmp_buf))
3708 { 3708 {
3709 fd = open_utf8(tmp_buf, O_RDONLY); 3709 fd = open_utf8(tmp_buf, O_RDONLY);
3710 if (fsamefile(fd, playlist->fd) > 0) 3710 if (fd >= 0 && fsamefile(fd, playlist->fd) > 0)
3711 { 3711 {
3712 /* Replace the current playlist with the new one and update 3712 /* Replace the current playlist with the new one and update
3713 indices */ 3713 indices */