summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-03-02 11:50:56 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-03-02 11:50:56 +0000
commit4f9e8b2ee2bc6cd8071cefc4f51a3b41129df7b4 (patch)
treeac645421ae9e544a6666de239c5da0b1a282ab8a /serial.c
parentdc9a3bae0bd6cc53bb6516c5f4eae765745b8f09 (diff)
downloadgpsd-4f9e8b2ee2bc6cd8071cefc4f51a3b41129df7b4.tar.gz
Defensive programming.
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/serial.c b/serial.c
index dbe79d79..a9377e82 100644
--- a/serial.c
+++ b/serial.c
@@ -122,10 +122,12 @@ void gpsd_set_speed(struct gps_device_t *session,
switch (parity)
{
case 'E':
+ case (char)2:
session->ttyset.c_iflag |= INPCK;
session->ttyset.c_cflag |= PARENB;
break;
case 'O':
+ case (char)1:
session->ttyset.c_iflag |= INPCK;
session->ttyset.c_cflag |= PARENB | PARODD;
break;