mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
as pointed out by funman in #rockbox, doing assumptions on the size of long
breaks 64bit archs (like simulators) but also doing >8 bit reads from memory addresses with assumptions on alignment without that being really sure seems a bit error-prone too. So we use memcmp() to compare 4 bytes strings... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18356 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
79177edfb2
commit
b2655cc559
1 changed files with 2 additions and 1 deletions
|
@ -835,7 +835,8 @@ bool checkString(int fd, char *string)
|
||||||
|
|
||||||
rb->read(fd, temp, 4);
|
rb->read(fd, temp, 4);
|
||||||
|
|
||||||
return (*(long*)temp == *(long*)string) ? 1 : 0;
|
/* return 1 on match, 0 on no match */
|
||||||
|
return !rb->memcmp(temp, string, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Read16BitsLowHigh(int fd)
|
int Read16BitsLowHigh(int fd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue