aboutsummaryrefslogtreecommitdiff
path: root/src/sg_sat_identify.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-01-19 13:08:58 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-01-19 13:08:58 +0000
commit400444efd4e3c2cd758aee250556c84e052634dc (patch)
tree4db54605f35f18dc4d997263e0218974ecfba463 /src/sg_sat_identify.c
parent239d147229acac3d3504360a38cd5ec8505d0d5e (diff)
downloadsg3_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_sat_identify.c')
-rw-r--r--src/sg_sat_identify.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sg_sat_identify.c b/src/sg_sat_identify.c
index ca6431ab..13c5306d 100644
--- a/src/sg_sat_identify.c
+++ b/src/sg_sat_identify.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2017 Douglas Gilbert.
+ * Copyright (c) 2006-2018 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.
@@ -99,11 +99,11 @@ static void usage()
"support the SCSI ATA\nPASS-THROUGH(32) command.\n");
}
-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]);
}
@@ -352,7 +352,7 @@ static int do_identify_dev(int sg_fd, bool do_packet, int cdb_len,
if (ok) { /* output result if it is available */
if (do_raw)
- dStrRaw((const char *)inBuff, 512);
+ dStrRaw(inBuff, 512);
else if (0 == do_hex) {
if (do_ident) {
usp = (const unsigned short *)inBuff;
@@ -370,7 +370,7 @@ static int do_identify_dev(int sg_fd, bool do_packet, int cdb_len,
sg_is_big_endian());
}
} else if (1 == do_hex)
- dStrHex((const char *)inBuff, 512, 0);
+ hex2stdout(inBuff, 512, 0);
else if (2 == do_hex)
dWordHex((const unsigned short *)inBuff, 256, 0,
sg_is_big_endian());
@@ -378,7 +378,7 @@ static int do_identify_dev(int sg_fd, bool do_packet, int cdb_len,
dWordHex((const unsigned short *)inBuff, 256, -2,
sg_is_big_endian());
else /* '-HHHH' hex bytes only */
- dStrHex((const char *)inBuff, 512, -1);
+ hex2stdout(inBuff, 512, -1);
}
return 0;
}