prevent storing IDs that are higher than we have knowledge about!

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2620 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2002-10-14 12:20:53 +00:00
parent dade571a99
commit c7e0bea57a

View file

@ -43,6 +43,7 @@ int lang_load(char *filename)
while(filesize>3) { while(filesize>3) {
id = (ptr[0]<<8) | ptr[1]; /* get two-byte id */ id = (ptr[0]<<8) | ptr[1]; /* get two-byte id */
ptr+=2; /* pass the id */ ptr+=2; /* pass the id */
if(id < LANG_LAST_INDEX_IN_ARRAY)
language_strings[id] = ptr; /* point to this string */ language_strings[id] = ptr; /* point to this string */
while(*ptr) { /* pass the string */ while(*ptr) { /* pass the string */
filesize--; filesize--;