Index: favorites.c =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/favorites.c,v retrieving revision 1.3 diff -u -r1.3 favorites.c --- favorites.c 8 Jan 2004 09:58:58 -0000 1.3 +++ favorites.c 16 Mar 2004 11:36:57 -0000 @@ -1,4 +1,6 @@ #include "plugin.h" +#include "string.h" + #define FAVORITES_FILE "/favorites.m3u" static struct plugin_api* rb; @@ -7,6 +9,8 @@ { struct mp3entry* id3; char track_path[MAX_PATH+1]; + char file_path[MAX_PATH+1]; + int fd, seek, result, len; /* this macro should be called as the first thing you do in the plugin. @@ -14,9 +18,7 @@ matches the machine it is running on */ TEST_PLUGIN_API(api); - /* if you don't use the parameter, you can do like - this to avoid the compiler warning about it */ - (void)parameter; + strncpy(file_path, parameter == NULL ? FAVORITES_FILE :(char*)parameter, sizeof file_path); rb = api; @@ -26,11 +28,11 @@ return PLUGIN_OK; } - fd = rb->open(FAVORITES_FILE, O_WRONLY); + fd = rb->open(file_path, O_WRONLY); // creat the file if it does not return on open. if (fd < 0) - fd = rb->creat(FAVORITES_FILE, 0); + fd = rb->creat(file_path, 0); if (fd > 0) { rb->strcpy(track_path, id3->path);