# HG changeset patch # User Matti Hamalainen # Date 1353449785 -7200 # Node ID 74ca6fb979fd5aa7ee19bc0b77e450db424af905 # Parent 3edc4c508f998432573f447db3a1e1b321713736 Cleanups. diff -r 3edc4c508f99 -r 74ca6fb979fd src/xs_length.c --- a/src/xs_length.c Wed Nov 21 00:16:20 2012 +0200 +++ b/src/xs_length.c Wed Nov 21 00:16:25 2012 +0200 @@ -398,8 +398,8 @@ goto error; } - if ((strncmp(psidH.magicID, "PSID", 4) && - strncmp(psidH.magicID, "RSID", 4)) || + if ((psidH.magic[0] != 'R' && psidH.magic[0] != 'P') || + psidH.magic[1] != 'S' || psidH.magic[2] != 'I' || psidH.magic[3] != 'D' || psidH.version < 1 || psidH.version > 3) { xs_error("Not a supported PSID or RSID file '%s'\n", filename); @@ -419,7 +419,7 @@ /* Check if we need to load PSIDv2NG header ... */ psidH2.flags = 0; /* Just silence a stupid gcc warning */ - if (psidH.version == 2 || psidH.version == 3) + if (psidH.version >= 2) { /* Yes, we need to */ if (!xs_fread_be16(inFile, &psidH2.flags) || @@ -490,7 +490,7 @@ xs_md5_append(&inState, &i8, sizeof(i8)); /* PSIDv2NG specific */ - if (psidH.version == 2 || psidH.version == 3) + if (psidH.version >= 2) { /* SEE SIDPLAY HEADERS FOR INFO */ i8 = (psidH2.flags >> 2) & 3;