From: Katsuhiro Suzuki Date: Tue, 23 Jan 2018 02:33:11 +0000 (+0900) Subject: cplay: fix size and nmemb of mp3 header of fread X-Git-Tag: v1.1.6~5 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=c35b0dfd4aff59e7aba00afc678051f0d6f836d5;p=tinycompress.git cplay: fix size and nmemb of mp3 header of fread 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 Signed-off-by: Vinod Koul --- 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);