diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2018-01-19 13:08:58 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2018-01-19 13:08:58 +0000 |
commit | 400444efd4e3c2cd758aee250556c84e052634dc (patch) | |
tree | 4db54605f35f18dc4d997263e0218974ecfba463 /src/sg_rtpg.c | |
parent | 239d147229acac3d3504360a38cd5ec8505d0d5e (diff) | |
download | sg3_utils-400444efd4e3c2cd758aee250556c84e052634dc.tar.gz |
add hex2stdout(), hex2stderr() and hex2str(); add testing/sg_tst_nvme; clean Makefile.freebsd in examples/ and testing/; NVMe error processing
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@745 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_rtpg.c')
-rw-r--r-- | src/sg_rtpg.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sg_rtpg.c b/src/sg_rtpg.c index b193b2bd..36e2cd23 100644 --- a/src/sg_rtpg.c +++ b/src/sg_rtpg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2017 Christophe Varoqui and Douglas Gilbert. + * Copyright (c) 2004-2018 Christophe Varoqui 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. @@ -17,6 +17,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif + #include "sg_lib.h" #include "sg_cmds_basic.h" #include "sg_cmds_extra.h" @@ -30,7 +31,7 @@ * to the given SCSI device. */ -static const char * version_str = "1.23 20171010"; +static const char * version_str = "1.24 20180118"; #define REPORT_TGT_GRP_BUFF_LEN 1024 @@ -77,11 +78,11 @@ static void usage() } -static void dStrRaw(const char* str, int len) +static void dStrRaw(const uint8_t * str, int len) { int k; - for (k = 0 ; k < len; ++k) + for (k = 0; k < len; ++k) printf("%c", str[k]); } @@ -236,7 +237,7 @@ int main(int argc, char * argv[]) report_len = (int)sizeof(reportTgtGrpBuff); } if (raw) { - dStrRaw((const char *)reportTgtGrpBuff, report_len); + dStrRaw(reportTgtGrpBuff, report_len); goto err_out; } if (verbose) @@ -244,7 +245,7 @@ int main(int argc, char * argv[]) if (hex) { if (verbose) printf("\nOutput response in hex:\n"); - dStrHex((const char *)reportTgtGrpBuff, report_len, 1); + hex2stdout(reportTgtGrpBuff, report_len, 1); goto err_out; } printf("Report target port groups:\n"); |