[PATCH 1/2] cplay: fix size and nmemb of mp3 header of fread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch swaps 'size' and 'nmemb' arguments of fread.
The fread returns always 1 (because 'nmemb' is 1) so checking
the return value is always failure.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@xxxxxxxxxxxxx>
---
 src/utils/cplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/utils/cplay.c b/src/utils/cplay.c
index e0603fd..bc95f0d 100644
--- a/src/utils/cplay.c
+++ b/src/utils/cplay.c
@@ -220,7 +220,7 @@ void play_samples(char *name, unsigned int card, unsigned int device,
 		exit(EXIT_FAILURE);
 	}
 
-	read = fread(&header, sizeof(header), 1, file);
+	read = fread(&header, 1, sizeof(header), file);
 	if (read != sizeof(header)) {
 		fprintf(stderr, "Unable to read header \n");
 		fclose(file);
-- 
2.15.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux