]> git.tuebingen.mpg.de Git - paraslash.git/commit
afh: Get rid of dummy entry at the end of afl[].
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Sep 2018 07:25:46 +0000 (09:25 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Dec 2018 13:40:42 +0000 (14:40 +0100)
commit54fda72783697f2258faa95d642224c47454b11b
tree1613c4c4e0dae5e133991fe30457387412b89399
parent30e16b04db8733e17fcf887508f2c33088eef2b6
afh: Get rid of dummy entry at the end of afl[].

The number of audio formats is a compile-time constant. It used to be
the array size of afl[] minus one due to the dummy entry. Without
it, it becomes simply the array size. This patch introduces
NUM_AUDIO_FORMATS as a shortcut for ARRAY_SIZE(afl) and adjusts
next_audio_format() to avoid the access of memory past the end of
the array. With these preparations in place, the dummy entry can
be removed.
afh_common.c