diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2008-08-28 08:07:04 +0000 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2008-08-28 08:07:04 +0000 |
| commit | b2655cc55922d834224ad0a36f45b37fac9dc925 (patch) | |
| tree | 6ab4b3bddadf348e1c68c060ab44c6658d940c37 /apps/plugins/mp3_encoder.c | |
| parent | 79177edfb2bb5e934c1630d723a0032c995942d7 (diff) | |
| download | rockbox-b2655cc55922d834224ad0a36f45b37fac9dc925.zip rockbox-b2655cc55922d834224ad0a36f45b37fac9dc925.tar.gz rockbox-b2655cc55922d834224ad0a36f45b37fac9dc925.tar.bz2 rockbox-b2655cc55922d834224ad0a36f45b37fac9dc925.tar.xz | |
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
Diffstat (limited to 'apps/plugins/mp3_encoder.c')
| -rw-r--r-- | apps/plugins/mp3_encoder.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 1e159da..7b799d2 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c @@ -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) |