changeset 469:d600f45c92d2

Silence a gcc warning; Use xs_*() file handling functions.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Jan 2007 03:50:00 +0000
parents 6963982fcbb6
children e19336d4b56d
files src/xs_length.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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);