From 400444efd4e3c2cd758aee250556c84e052634dc Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Fri, 19 Jan 2018 13:08:58 +0000 Subject: 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 --- src/sg_sat_identify.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/sg_sat_identify.c') 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; } -- cgit v1.2.3