Fixed database export crashing with long tags. And failing without DB loaded to RAM due to the recently added new tags in DB, thus reaching the fd limit.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12481 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2007-02-25 19:01:32 +00:00
parent e53e67014f
commit fcf8145fee
2 changed files with 3 additions and 3 deletions

View file

@ -2641,11 +2641,11 @@ bool tagcache_modify_numeric_entry(struct tagcache_search *tcs,
static bool write_tag(int fd, const char *tagstr, const char *datastr) static bool write_tag(int fd, const char *tagstr, const char *datastr)
{ {
char buf[256]; char buf[512];
int i; int i;
snprintf(buf, sizeof buf, "%s=\"", tagstr); snprintf(buf, sizeof buf, "%s=\"", tagstr);
for (i = strlen(buf); i < (long)sizeof(buf)-2; i++) for (i = strlen(buf); i < (long)sizeof(buf)-3; i++)
{ {
if (*datastr == '\0') if (*datastr == '\0')
break; break;

View file

@ -25,7 +25,7 @@
#undef MAX_PATH /* this avoids problems when building simulator */ #undef MAX_PATH /* this avoids problems when building simulator */
#define MAX_PATH 260 #define MAX_PATH 260
#define MAX_OPEN_FILES 8 #define MAX_OPEN_FILES 11
#ifndef SEEK_SET #ifndef SEEK_SET
#define SEEK_SET 0 #define SEEK_SET 0