summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-12-13 23:33:46 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-12-13 23:37:26 -0500
commiteaf717744d425e0bb8905f451e7443b07b67f97b (patch)
tree99b71fd1608bbf14a821652c444c855b66a8edbf /apps
parentc6c1d62489b81c3568aa7d57a01c543a1c3f1f4a (diff)
downloadrockbox-eaf717744d425e0bb8905f451e7443b07b67f97b.tar.gz
rockbox-eaf717744d425e0bb8905f451e7443b07b67f97b.zip
[Bug Fix] open_plugin.c update checksum check for spinning disks
Lang_id keys take LANG_LAST_INDEX_IN_ARRAY for the checksum spinning disks did not have the code to do so Change-Id: I617e1a5462d8d6c4830a9b59171bdd7167d5e7a1
Diffstat (limited to 'apps')
-rw-r--r--apps/open_plugin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/open_plugin.c b/apps/open_plugin.c
index 45dd7cdd2c..58c3058fce 100644
--- a/apps/open_plugin.c
+++ b/apps/open_plugin.c
@@ -155,10 +155,14 @@ static int op_update_dat(struct open_plugin_entry_t *entry, bool clear)
155 /* Only read the hash lang id and checksum */ 155 /* Only read the hash lang id and checksum */
156 uint32_t hash_langid_csum[3] = {0}; 156 uint32_t hash_langid_csum[3] = {0};
157 const off_t hlc_sz = sizeof(hash_langid_csum); 157 const off_t hlc_sz = sizeof(hash_langid_csum);
158
159 uint32_t csum = open_plugin_csum +
160 (lang_id <= OPEN_PLUGIN_LANG_INVALID ? 0 : LANG_LAST_INDEX_IN_ARRAY);
161
158 while (read(fd, &hash_langid_csum, hlc_sz) == hlc_sz) 162 while (read(fd, &hash_langid_csum, hlc_sz) == hlc_sz)
159 { 163 {
160 if ((hash_langid_csum[0] == hash || (int32_t)hash_langid_csum[1] == lang_id) && 164 if ((hash_langid_csum[0] == hash || (int32_t)hash_langid_csum[1] == lang_id) &&
161 hash_langid_csum[2] == open_plugin_csum) 165 hash_langid_csum[2] == csum)
162 { 166 {
163 logf("OP update *Entry Exists* hash: %x langid: %d", 167 logf("OP update *Entry Exists* hash: %x langid: %d",
164 hash_langid_csum[0], (int32_t)hash_langid_csum[1]); 168 hash_langid_csum[0], (int32_t)hash_langid_csum[1]);