forked from len0rd/rockbox
radio_load_presets() no longer loads more than MAX_PRESETS from the presets file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4361 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
642cce2e33
commit
cd55e03a30
1 changed files with 1 additions and 4 deletions
|
@ -545,7 +545,6 @@ void radio_load_presets(void)
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char *freq;
|
char *freq;
|
||||||
char *name;
|
char *name;
|
||||||
int num_presets = 0;
|
|
||||||
bool done = false;
|
bool done = false;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -557,7 +556,7 @@ void radio_load_presets(void)
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
while(!done && num_presets < MAX_PRESETS)
|
while(!done && i < MAX_PRESETS)
|
||||||
{
|
{
|
||||||
rc = read_line(fd, buf, 128);
|
rc = read_line(fd, buf, 128);
|
||||||
if(rc > 0)
|
if(rc > 0)
|
||||||
|
@ -568,8 +567,6 @@ void radio_load_presets(void)
|
||||||
strncpy(presets[i].name, name, 27);
|
strncpy(presets[i].name, name, 27);
|
||||||
presets[i].name[27] = 0;
|
presets[i].name[27] = 0;
|
||||||
i++;
|
i++;
|
||||||
if(num_presets == MAX_PRESETS)
|
|
||||||
done = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue