summaryrefslogtreecommitdiffstats
path: root/sys/dev/speaker/spkr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/speaker/spkr.c')
-rw-r--r--sys/dev/speaker/spkr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 97280b1..f05e5a1 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.24 1996/03/27 19:07:33 bde Exp $
+ * $Id: spkr.c,v 1.25 1996/07/20 18:48:54 joerg Exp $
*/
#include "speaker.h"
@@ -514,7 +514,7 @@ spkrwrite(dev, uio, ioflag)
if (minor(dev) != 0)
return(ENXIO);
- else if (uio->uio_resid > DEV_BSIZE) /* prevent system crashes */
+ else if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */
return(E2BIG);
else
{
@@ -524,8 +524,11 @@ spkrwrite(dev, uio, ioflag)
n = uio->uio_resid;
cp = spkr_inbuf->b_un.b_addr;
- if (!(error = uiomove(cp, n, uio)))
+ error = uiomove(cp, n, uio);
+ if (!error) {
+ cp[n] = '\0';
playstring(cp, n);
+ }
return(error);
}
}
OpenPOWER on IntegriCloud