summaryrefslogtreecommitdiff
path: root/gpsctl.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-03-02 14:47:37 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-03-02 14:47:37 +0000
commitfae478381d10ac60513db92927312f7bff437926 (patch)
tree0683e4a96afa30bc2a825ab841d161634874dde0 /gpsctl.c
parentf0353549971ff5edd2b6631a9f45f5289c29ca4e (diff)
downloadgpsd-fae478381d10ac60513db92927312f7bff437926.tar.gz
Process mode arguments a bit more forgivingly.
Diffstat (limited to 'gpsctl.c')
-rw-r--r--gpsctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gpsctl.c b/gpsctl.c
index 22c4755e..325dc84d 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -276,8 +276,8 @@ int main(int argc, char **argv)
status = 0;
if (modespec!=NULL) {
*modespec = '\0';
- if (*++modespec !='8') {
- gpsd_report(LOG_ERROR, "No support for word lengths != 8.\n");
+ if (strchr("78", *++modespec) == NULL) {
+ gpsd_report(LOG_ERROR, "No support for that word lengths.\n");
status = 1;
}
parity = *++modespec;
@@ -481,8 +481,8 @@ int main(int argc, char **argv)
status = 0;
if (modespec!=NULL) {
*modespec = '\0';
- if (*++modespec !='8') {
- gpsd_report(LOG_ERROR, "No support for word lengths != 8.\n");
+ if (strchr("78", *++modespec) == NULL) {
+ gpsd_report(LOG_ERROR, "No support for that word lengths.\n");
status = 1;
}
parity = *++modespec;