aboutsummaryrefslogtreecommitdiff
path: root/src/sg_rtpg.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2009-07-24 19:58:51 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2009-07-24 19:58:51 +0000
commit7a31f052e8013960cc162447397ca552ff50dfb2 (patch)
treedae6957e16343aa34d23a8f639fc9f8be37e875a /src/sg_rtpg.c
parent42a33ce7e76f90eea8e60d7efbd65a44b1f0c65a (diff)
downloadsg3_utils-7a31f052e8013960cc162447397ca552ff50dfb2.tar.gz
reverse out printf(%#) change, broken for %#02x when value is 0
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@284 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_rtpg.c')
-rw-r--r--src/sg_rtpg.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sg_rtpg.c b/src/sg_rtpg.c
index 466c887d..802a9baa 100644
--- a/src/sg_rtpg.c
+++ b/src/sg_rtpg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2009 Christophe Varoqui and Douglas Gilbert.
+ * Copyright (c) 2004-2008 Christophe Varoqui and Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@
* to the given SCSI device.
*/
-static char * version_str = "1.13 20090717";
+static char * version_str = "1.13 20080513";
#define REPORT_TGT_GRP_BUFF_LEN 1024
@@ -208,7 +208,7 @@ int main(int argc, char * argv[])
fprintf(stderr, "Version: %s\n", version_str);
return 0;
default:
- fprintf(stderr, "unrecognised option code %#x ??\n", c);
+ fprintf(stderr, "unrecognised option code 0x%x ??\n", c);
usage();
return SG_LIB_SYNTAX_ERROR;
}
@@ -284,10 +284,10 @@ int main(int argc, char * argv[])
for (k = 4, ucp = reportTgtGrpBuff + 4; k < report_len;
k += off, ucp += off) {
- printf(" target port group id : %#x , Pref=%d\n",
+ printf(" target port group id : 0x%x , Pref=%d\n",
(ucp[2] << 8) + ucp[3], !!(ucp[0] & 0x80));
printf(" target port group asymmetric access state : ");
- printf("%#02x", ucp[0] & 0x0f);
+ printf("0x%02x", ucp[0] & 0x0f);
if (decode)
decode_tpgs_state(ucp[0] & 0x0f);
printf("\n");
@@ -300,13 +300,13 @@ int main(int argc, char * argv[])
printf("AO_SUP : %d\n", !!(ucp[1] & 0x01));
printf(" status code : ");
- printf("%#02x", ucp[5]);
+ printf("0x%02x", ucp[5]);
if (decode)
decode_status(ucp[5]);
printf("\n");
printf(" vendor unique status : ");
- printf("%#02x\n", ucp[6]);
+ printf("0x%02x\n", ucp[6]);
printf(" target port count : ");
tgt_port_count = ucp[7];
@@ -315,7 +315,7 @@ int main(int argc, char * argv[])
for (j = 0; j < tgt_port_count * 4; j += 4) {
if (0 == j)
printf(" Relative target port ids:\n");
- printf(" %#02x\n",
+ printf(" 0x%02x\n",
(ucp[8 + j + 2] << 8) + ucp[8 + j + 3]);
}
off = 8 + j;