summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool8
1 files changed, 7 insertions, 1 deletions
diff --git a/ubxtool b/ubxtool
index 7087934d..d961eedf 100755
--- a/ubxtool
+++ b/ubxtool
@@ -5679,7 +5679,13 @@ for (opt, val) in options:
elif opt == '-r':
opts['read_only'] = True
elif opt == '-s':
- opts['input_speed'] = int(val)
+ try:
+ opts['input_speed'] = int(val)
+ except ValueError:
+ sys.stderr.write('%s: -s invalid speed %s\n' %
+ (PROG_NAME, val))
+ sys.exit(1)
+
if opts['input_speed'] not in gps_model.speeds:
sys.stderr.write('%s: -s invalid speed %s\n' %
(PROG_NAME, opts['input_speed']))