diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2009-08-30 03:52:11 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2009-08-30 03:52:11 +0000 |
commit | ad9835c689575a66f2c6ce1f6efe121642061be8 (patch) | |
tree | 3cf01eb762c575dd159edbf9f82db2fd9c1dfa44 | |
parent | f701fc516633798524369de07fedb8a21e8fc99f (diff) | |
download | rockbox-ad9835c689575a66f2c6ce1f6efe121642061be8.tar.gz rockbox-ad9835c689575a66f2c6ce1f6efe121642061be8.zip |
Logic was backwards on the check for NSF file format. Fix that and save one memcmp.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22559 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/metadata/nsf.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/metadata/nsf.c b/apps/metadata/nsf.c index a12af14347..e1ad331d75 100644 --- a/apps/metadata/nsf.c +++ b/apps/metadata/nsf.c | |||
@@ -28,14 +28,17 @@ bool get_nsf_metadata(int fd, struct mp3entry* id3) | |||
28 | id3->vbr = false; | 28 | id3->vbr = false; |
29 | id3->filesize = filesize(fd); | 29 | id3->filesize = filesize(fd); |
30 | 30 | ||
31 | if (memcmp(buf,"NESM",4) && memcmp(buf,"NSFE",4)) | 31 | if (memcmp(buf,"NSFE",4) == 0) /* only NESM contain metadata */ |
32 | { | ||
33 | return false; | ||
34 | } | ||
35 | else if (memcmp(buf, "NESM",4)) /* only NESM contain metadata */ | ||
36 | { | 32 | { |
37 | return true; | 33 | return true; |
38 | } | 34 | } |
35 | else | ||
36 | { | ||
37 | if (memcmp(buf, "NESM",4) != 0) /* not a valid format*/ | ||
38 | { | ||
39 | return false; | ||
40 | } | ||
41 | } | ||
39 | 42 | ||
40 | p = id3->id3v2buf; | 43 | p = id3->id3v2buf; |
41 | 44 | ||