# HG changeset patch # User Matti Hamalainen # Date 1169697000 0 # Node ID d600f45c92d20875823fc866cabe5d8d5930dc9b # Parent 6963982fcbb678f5b82ce2ab9e1805ff68dc4bbe Silence a gcc warning; Use xs_*() file handling functions. diff -r 6963982fcbb6 -r d600f45c92d2 src/xs_length.c --- a/src/xs_length.c Thu Jan 25 03:46:04 2007 +0000 +++ b/src/xs_length.c Thu Jan 25 03:50:00 2007 +0000 @@ -448,9 +448,8 @@ return -1; /* Read PSID header in */ - xs_fgets(psidH.magicID, sizeof(psidH.magicID), inFile); - if ((psidH.magicID[0] != 'P' && psidH.magicID[0] != 'R') || - (psidH.magicID[1] != 'S') || (psidH.magicID[2] != 'I') || (psidH.magicID[3] != 'D')) { + xs_fread(psidH.magicID, sizeof(psidH.magicID), 1, inFile); + if (strncmp(psidH.magicID, "PSID", 4) && strncmp(psidH.magicID, "RSID", 4)) { xs_fclose(inFile); xs_error(_("Not a PSID or RSID file '%s'\n"), pcFilename); return -2; @@ -465,9 +464,9 @@ psidH.startSong = xs_fread_be16(inFile); psidH.speed = xs_fread_be32(inFile); - xs_fgets(psidH.sidName, sizeof(psidH.sidName), inFile); - xs_fgets(psidH.sidAuthor, sizeof(psidH.sidAuthor), inFile); - xs_fgets(psidH.sidCopyright, sizeof(psidH.sidCopyright), inFile); + xs_fread(psidH.sidName, sizeof(gchar), sizeof(psidH.sidName), inFile); + xs_fread(psidH.sidAuthor, sizeof(gchar), sizeof(psidH.sidAuthor), inFile); + xs_fread(psidH.sidCopyright, sizeof(gchar), sizeof(psidH.sidCopyright), inFile); if (xs_feof(inFile) || xs_ferror(inFile)) { xs_fclose(inFile); @@ -476,6 +475,8 @@ } /* Check if we need to load PSIDv2NG header ... */ + psidH2.flags = 0; /* Just silence a stupid gcc warning */ + if (psidH.version == 2) { /* Yes, we need to */ psidH2.flags = xs_fread_be16(inFile);