Skip to content

Commit

Permalink
sg_requests: fix bug in output
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@915 6180dd3e-e324-4e3e-922d-17de1ae2f315
  • Loading branch information
doug-gilbert committed Oct 1, 2021
1 parent 20704a8 commit c1ce6d6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Expand Up @@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.

Changelog for pre-release sg3_utils-1.47 [20210924] [svn: r914]
Changelog for pre-release sg3_utils-1.47 [20211001] [svn: r915]
- transport error handling improved. To fix report of a
BAD_TARGET transport error but the utility still continued.
- introduce SG_LIB_TRANSPORT_ERROR [35] exit status
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Expand Up @@ -2,7 +2,7 @@ sg3-utils (1.47-0.1) unstable; urgency=low

* New upstream version

-- Douglas Gilbert <dgilbert@interlog.com> Sat, 25 Sep 2021 00:01:00 -0400
-- Douglas Gilbert <dgilbert@interlog.com> Fri, 01 Oct 2021 12:00:00 -0400

sg3-utils (1.46-0.1) unstable; urgency=low

Expand Down
2 changes: 1 addition & 1 deletion doc/sg3_utils.8
@@ -1,4 +1,4 @@
.TH SG3_UTILS "8" "August 2021" "sg3_utils\-1.47" SG3_UTILS
.TH SG3_UTILS "8" "October 2021" "sg3_utils\-1.47" SG3_UTILS
.SH NAME
sg3_utils \- a package of utilities for sending SCSI commands
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion sg3_utils.spec
Expand Up @@ -84,7 +84,7 @@ fi
%{_libdir}/*.la

%changelog
* Sat Sep 25 2021 - dgilbert at interlog dot com
* Fri Oct 01 2021 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.47

Expand Down
13 changes: 7 additions & 6 deletions src/sg_decode_sense.c
Expand Up @@ -30,7 +30,7 @@
#include "sg_unaligned.h"


static const char * version_str = "1.22 20210610";
static const char * version_str = "1.23 20211001";

#define MAX_SENSE_LEN 1024 /* max descriptor format actually: 255+8 */

Expand Down Expand Up @@ -282,7 +282,7 @@ write2wfn(FILE * fp, struct opts_t * op)
int
main(int argc, char *argv[])
{
int k, err;
int k, err, blen;
int ret = 0;
unsigned int ui;
size_t s;
Expand All @@ -293,8 +293,9 @@ main(int argc, char *argv[])
struct opts_t opts;

op = &opts;
blen = sizeof(b);
memset(op, 0, sizeof(opts));
memset(b, 0, sizeof(b));
memset(b, 0, blen);
ret = parse_cmd_line(op, argc, argv);

#ifdef DEBUG
Expand Down Expand Up @@ -339,7 +340,7 @@ main(int argc, char *argv[])
}

if (op->do_status) {
sg_get_scsi_status_str(op->sstatus, sizeof(b) - 1, b);
sg_get_scsi_status_str(op->sstatus, blen, b);
printf("SCSI status: %s\n", b);
}

Expand Down Expand Up @@ -421,10 +422,10 @@ main(int argc, char *argv[])
sa = op->sense[1] & 0x1f;
else
sa = 0;
sg_get_opcode_sa_name(opcode, sa, 0, sizeof(b), b);
sg_get_opcode_sa_name(opcode, sa, 0, blen, b);
} else
sg_get_sense_str(NULL, op->sense, op->sense_len,
op->verbose, sizeof(b) - 1, b);
op->verbose, blen, b);
printf("%s\n", b);
}
fini:
Expand Down
4 changes: 2 additions & 2 deletions src/sg_requests.c
Expand Up @@ -34,7 +34,7 @@
* This program issues the SCSI command REQUEST SENSE to the given SCSI device.
*/

static const char * version_str = "1.37 20210830";
static const char * version_str = "1.38 20211001";

#define MAX_REQS_RESP_LEN 255
#define DEF_REQS_RESP_LEN 252
Expand Down Expand Up @@ -478,7 +478,7 @@ main(int argc, char * argv[])

sg_get_sense_str(NULL, rsBuff, act_din_len,
false, sizeof(bb), bb);
pr2serr("data-in decoded as sense:\n%s\n", b);
pr2serr("data-in decoded as sense:\n%s\n", bb);
}
}
}
Expand Down

0 comments on commit c1ce6d6

Please sign in to comment.