1
0
Fork 0
forked from len0rd/rockbox

FS#11751: increase buffer size of settings to store path.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28603 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Teruaki Kawashima 2010-11-15 12:33:47 +00:00
parent 7ee3b11022
commit 2142628a2d
3 changed files with 8 additions and 6 deletions

View file

@ -1038,7 +1038,8 @@ MENUITEM_FUNCTION(set_backdrop_item, 0, ID2P(LANG_SET_AS_BACKDROP),
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
static bool set_recdir(void) static bool set_recdir(void)
{ {
strlcpy(global_settings.rec_directory, selected_file, MAX_FILENAME+1); strlcpy(global_settings.rec_directory, selected_file,
sizeof(global_settings.rec_directory));
settings_save(); settings_save();
return false; return false;
} }

View file

@ -147,12 +147,12 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */ #define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */ /* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 194 #define PLUGIN_API_VERSION 195
/* update this to latest version if a change to the api struct breaks /* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */ new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 194 #define PLUGIN_MIN_API_VERSION 195
/* plugin return codes */ /* plugin return codes */
/* internal returns start at 0x100 to make exit(1..255) work */ /* internal returns start at 0x100 to make exit(1..255) work */

View file

@ -42,6 +42,7 @@ struct opt_items {
/** Setting values defines **/ /** Setting values defines **/
#define MAX_FILENAME 32 #define MAX_FILENAME 32
#define MAX_PATHNAME 80
enum { enum {
@ -417,7 +418,7 @@ struct user_settings
int rec_split_method; /* time/filesize */ int rec_split_method; /* time/filesize */
int rec_prerecord_time; /* In seconds, 0-30, 0 means OFF */ int rec_prerecord_time; /* In seconds, 0-30, 0 means OFF */
char rec_directory[MAX_FILENAME+1]; char rec_directory[MAX_PATHNAME+1];
int cliplight; /* 0 = off int cliplight; /* 0 = off
1 = main lcd 1 = main lcd
2 = main and remote lcd 2 = main and remote lcd
@ -531,7 +532,7 @@ struct user_settings
unsigned char rsbs_file[MAX_FILENAME+1]; /* last remote statusbar skin */ unsigned char rsbs_file[MAX_FILENAME+1]; /* last remote statusbar skin */
#endif #endif
unsigned char lang_file[MAX_FILENAME+1]; /* last language */ unsigned char lang_file[MAX_FILENAME+1]; /* last language */
unsigned char playlist_catalog_dir[MAX_FILENAME+1]; unsigned char playlist_catalog_dir[MAX_PATHNAME+1];
int skip_length; /* skip length */ int skip_length; /* skip length */
int max_files_in_dir; /* Max entries in directory (file browser) */ int max_files_in_dir; /* Max entries in directory (file browser) */
int max_files_in_playlist; /* Max entries in playlist */ int max_files_in_playlist; /* Max entries in playlist */
@ -810,7 +811,7 @@ struct user_settings
#endif #endif
} hw_eq_bands[AUDIOHW_EQ_BAND_NUM]; } hw_eq_bands[AUDIOHW_EQ_BAND_NUM];
#endif /* AUDIOHW_HAVE_EQ */ #endif /* AUDIOHW_HAVE_EQ */
char start_directory[2*MAX_FILENAME+1]; char start_directory[MAX_PATHNAME+1];
}; };
/** global variables **/ /** global variables **/