summaryrefslogtreecommitdiffstats
path: root/sys/dev/speaker
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-10-14 16:37:58 +0000
committerache <ache@FreeBSD.org>1994-10-14 16:37:58 +0000
commita92485cbaca698673d223c798fdd1e66a54101fd (patch)
tree832334bce55a7b642cab2cb028ff2c5c73d81f6d /sys/dev/speaker
parent0cc1383e69eeaf09e9561ec86b72ce41163a2faa (diff)
downloadFreeBSD-src-a92485cbaca698673d223c798fdd1e66a54101fd.zip
FreeBSD-src-a92485cbaca698673d223c798fdd1e66a54101fd.tar.gz
Fix range checking bug, pointed by peter@haywire.dialix.com
Diffstat (limited to 'sys/dev/speaker')
-rw-r--r--sys/dev/speaker/spkr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 4f9f2fa..aff7052 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -4,7 +4,7 @@
* v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993
* modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su>
*
- * $Id: spkr.c,v 1.8 1994/04/21 14:21:50 sos Exp $
+ * $Id: spkr.c,v 1.9 1994/08/13 03:50:14 wollman Exp $
*/
#include "speaker.h"
@@ -329,14 +329,14 @@ size_t slen;
else
{
GETNUM(cp, octave);
- if (octave >= sizeof(pitchtab) / OCTAVE_NOTES)
+ if (octave >= sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES)
octave = DFLT_OCTAVE;
octprefix = TRUE;
}
break;
case '>':
- if (octave < sizeof(pitchtab) / OCTAVE_NOTES - 1)
+ if (octave < sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES - 1)
octave++;
octprefix = TRUE;
break;
OpenPOWER on IntegriCloud