summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-01-19 21:12:38 +0000
committerJens Arnold <amiconn@rockbox.org>2005-01-19 21:12:38 +0000
commit3c2fefdb99b24a000a5d896097cba479ad0e62a7 (patch)
tree7da72cddba360f20da34bcd11204e1efc2851911
parentcb7a3d27e2f036d90a5c359cf850d18ab20c4d5c (diff)
downloadrockbox-3c2fefdb99b24a000a5d896097cba479ad0e62a7.tar.gz
rockbox-3c2fefdb99b24a000a5d896097cba479ad0e62a7.zip
Bugfix: Due to the wrong position of the LANG_LAST_INDEX_IN_ARRAY marker, lang_load() was potentially unsafe. Loading a newer .lng file with an older rockbox build would have caused an out-of-bound access of language_strings[].
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5607 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/genlang9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/genlang b/tools/genlang
index 6032c84899..e13cd3faf9 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -100,15 +100,18 @@ for(@hfile) {
100 print HFILE " $_,\n"; 100 print HFILE " $_,\n";
101} 101}
102 102
103print HFILE " /* --- below this follows voice-only strings --- */\n", 103print HFILE <<MOO
104 " VOICEONLY_DELIMITER = 0x8000,\n"; 104 LANG_LAST_INDEX_IN_ARRAY, /* this is not a string, this is a marker */
105 /* --- below this follows voice-only strings --- */
106 VOICEONLY_DELIMITER = 0x8000,
107MOO
108 ;
105 109
106for(@vfile) { 110for(@vfile) {
107 print HFILE " $_,\n"; 111 print HFILE " $_,\n";
108} 112}
109 113
110print HFILE <<MOO 114print HFILE <<MOO
111 LANG_LAST_INDEX_IN_ARRAY /* this is not a string, this is a marker */
112}; 115};
113/* end of generated enum list */ 116/* end of generated enum list */
114MOO 117MOO