diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/tty_nmea.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/tty_nmea.c b/sys/kern/tty_nmea.c index bde37380fc2..5a1fa9b547a 100644 --- a/sys/kern/tty_nmea.c +++ b/sys/kern/tty_nmea.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_nmea.c,v 1.2 2006/06/01 22:32:46 ckuethe Exp $ */ +/* $OpenBSD: tty_nmea.c,v 1.3 2006/06/01 23:17:08 ckuethe Exp $ */ /* * Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org> @@ -267,8 +267,10 @@ nmea_hdlr(struct nmea *np, int c) void nmea_bufadd(struct nmea *np, int c) { - np->cbuf[np->pos++] = c; - np->cksum ^= c; + if (np->pos < NMEAMAX){ + np->cbuf[np->pos++] = c; + np->cksum ^= c; + } } /* |