From b2655cc55922d834224ad0a36f45b37fac9dc925 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 28 Aug 2008 08:07:04 +0000 Subject: [PATCH] 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 --- apps/plugins/mp3_encoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 1e159da2c8..7b799d2ef8 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)