diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-06-11 03:57:05 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-06-11 03:57:05 +0000 |
commit | bee57c535c29a01cadfaa660d8c0182288960c33 (patch) | |
tree | 2a9355f53953526dc12f101d6bf6b26962f5dbbe /src/sg_read_buffer.c | |
parent | 30363466e3580cae5f428c9bf35caa934cef469b (diff) | |
download | sg3_utils-bee57c535c29a01cadfaa660d8c0182288960c33.tar.gz |
sg_read_buffer: fix --length= problem; pt: new configure option --enable-pt_dummy builds the library with sg_pt_dummy.c instead of OS specific code
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@904 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_read_buffer.c')
-rw-r--r-- | src/sg_read_buffer.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sg_read_buffer.c b/src/sg_read_buffer.c index 4eb5da4a..33aa1673 100644 --- a/src/sg_read_buffer.c +++ b/src/sg_read_buffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019 Luben Tuikov and Douglas Gilbert. + * Copyright (c) 2006-2021 Luben Tuikov and Douglas Gilbert. * All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the BSD_LICENSE file. @@ -39,7 +39,7 @@ * device. */ -static const char * version_str = "1.30 20191220"; /* spc5r22 */ +static const char * version_str = "1.31 20210608"; /* spc6r05 */ #ifndef SG_READ_BUFFER_10_CMD @@ -410,7 +410,8 @@ main(int argc, char * argv[]) bool do_raw = false; bool verbose_given = false; bool version_given = false; - int res, c, len, k, inhex_len; + int res, c, len, k; + int inhex_len = 0; int sg_fd = -1; int do_help = 0; int do_hex = 0; @@ -476,7 +477,7 @@ main(int argc, char * argv[]) do_long = true; break; case 'm': - if (isdigit(*optarg)) { + if (isdigit((uint8_t)*optarg)) { rb_mode = sg_get_num(optarg); if ((rb_mode < 0) || (rb_mode > 31)) { pr2serr("argument to '--mode' should be in the range 0 " @@ -574,8 +575,6 @@ main(int argc, char * argv[]) return 0; } - rb_len = 0; - inhex_len = 0; if (device_name && fname) { pr2serr("Confused: both DEVICE (%s) and --inhex= option given. One " "only please\n", device_name); |