alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cplay: fix size and nmemb of mp3 header of fread
@ 2018-01-23  2:33 Katsuhiro Suzuki
  2018-01-23  2:33 ` [PATCH 2/2] cplay: add option to specify codec ID Katsuhiro Suzuki
  2018-02-01 10:53 ` [PATCH 1/2] cplay: fix size and nmemb of mp3 header of fread Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Katsuhiro Suzuki @ 2018-01-23  2:33 UTC (permalink / raw)
  To: alsa-devel, Vinod Koul
  Cc: Katsuhiro Suzuki, Jassi Brar, Takashi Iwai, Masami Hiramatsu

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@socionext.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-01 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23  2:33 [PATCH 1/2] cplay: fix size and nmemb of mp3 header of fread Katsuhiro Suzuki
2018-01-23  2:33 ` [PATCH 2/2] cplay: add option to specify codec ID Katsuhiro Suzuki
2018-02-01 10:52   ` Vinod Koul
2018-02-01 10:53 ` [PATCH 1/2] cplay: fix size and nmemb of mp3 header of fread Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).