diff options
author | Jurgen Kramer <gtmkramer@xs4all.nl> | 2013-09-09 12:02:29 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-09-09 12:02:29 +0200 |
commit | 719faff80962a5d93c09980673f08048ae58add6 (patch) | |
tree | a30e23f798158ded886bd34f78b037305ce827af | |
parent | 8f57464190eb683d9517d8cfbd2cefb6223c6f1d (diff) | |
download | alsa-utils-719faff80962a5d93c09980673f08048ae58add6.tar.gz |
aplay: fix two off by one errors
Attached patch for aplay fixes two off-by-one errors preventing usage
of the last available sample format.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | aplay/aplay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/aplay/aplay.c b/aplay/aplay.c index 89c6b06..e0631c4 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -242,7 +242,7 @@ _("Usage: %s [OPTION]... [FILE]...\n" ) , command); printf(_("Recognized sample formats are:")); - for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { + for (k = 0; k <= SND_PCM_FORMAT_LAST; ++k) { const char *s = snd_pcm_format_name(k); if (s) printf(" %s", s); @@ -1114,7 +1114,7 @@ static void show_available_sample_formats(snd_pcm_hw_params_t* params) snd_pcm_format_t format; fprintf(stderr, "Available formats:\n"); - for (format = 0; format < SND_PCM_FORMAT_LAST; format++) { + for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) { if (snd_pcm_hw_params_test_format(handle, params, format) == 0) fprintf(stderr, "- %s\n", snd_pcm_format_name(format)); } |