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:
Daniel Stenberg 2008-08-28 08:07:04 +00:00
parent 79177edfb2
commit b2655cc559

View file

@ -835,7 +835,8 @@ bool checkString(int fd, char *string)
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)