summaryrefslogtreecommitdiff
path: root/apps/metadata/nsf.c
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2009-08-30 03:52:11 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2009-08-30 03:52:11 +0000
commitad9835c689575a66f2c6ce1f6efe121642061be8 (patch)
tree3cf01eb762c575dd159edbf9f82db2fd9c1dfa44 /apps/metadata/nsf.c
parentf701fc516633798524369de07fedb8a21e8fc99f (diff)
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
Diffstat (limited to 'apps/metadata/nsf.c')
-rw-r--r--apps/metadata/nsf.c13
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)
id3->vbr = false;
id3->filesize = filesize(fd);
- if (memcmp(buf,"NESM",4) && memcmp(buf,"NSFE",4))
- {
- return false;
- }
- else if (memcmp(buf, "NESM",4)) /* only NESM contain metadata */
+ if (memcmp(buf,"NSFE",4) == 0) /* only NESM contain metadata */
{
return true;
}
+ else
+ {
+ if (memcmp(buf, "NESM",4) != 0) /* not a valid format*/
+ {
+ return false;
+ }
+ }
p = id3->id3v2buf;