diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2022-01-19 19:12:36 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2022-01-19 19:12:36 +0000 |
commit | 84c586f1f1d8bd102928f3ae95d1d1185a59de8f (patch) | |
tree | 4e078230ad1395e3524357e64abf506e35f5acb8 /src/sg_stpg.c | |
parent | 31de60f68ae11ed1ad16510e0e86b5603f93bda3 (diff) | |
download | sg3_utils-84c586f1f1d8bd102928f3ae95d1d1185a59de8f.tar.gz |
round of coverity identified issue fixes (and non-issues)
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@931 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_stpg.c')
-rw-r--r-- | src/sg_stpg.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sg_stpg.c b/src/sg_stpg.c index e57b13c5..a12b5cac 100644 --- a/src/sg_stpg.c +++ b/src/sg_stpg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2021 Hannes Reinecke, Christophe Varoqui, Douglas Gilbert + * Copyright (c) 2004-2022 Hannes Reinecke, Christophe Varoqui, 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. @@ -34,7 +34,7 @@ * to the given SCSI device. */ -static const char * version_str = "1.20 20210610"; +static const char * version_str = "1.21 20220118"; #define TGT_GRP_BUFF_LEN 1024 #define MX_ALLOC_LEN (0xc000 + 0x80) @@ -142,15 +142,14 @@ dStrRaw(const uint8_t * str, int len) static int decode_target_port(uint8_t * buff, int len, int *d_id, int *d_tpg) { - int c_set, assoc, desig_type, i_len; - int off, u; + int c_set, assoc, desig_type, i_len, off; const uint8_t * bp; const uint8_t * ip; *d_id = -1; *d_tpg = -1; off = -1; - while ((u = sg_vpd_dev_id_iter(buff, len, &off, -1, -1, -1)) == 0) { + while (sg_vpd_dev_id_iter(buff, len, &off, -1, -1, -1) == 0) { bp = buff + off; i_len = bp[3]; if ((off + i_len + 4) > len) { |