diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2009-07-22 02:22:05 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2009-07-22 02:22:05 +0000 |
commit | 017aa7827624e209683c4376074d598ed518e915 (patch) | |
tree | 9ad686b4865d2384dc72058ef8284996f4d0da79 /src/sg_rtpg.c | |
parent | 137715a6cb23b4d53521fdeffbfb6164bce4781b (diff) | |
download | sg3_utils-017aa7827624e209683c4376074d598ed518e915.tar.gz |
change many printf(0x%x) format strings to %#x
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@281 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_rtpg.c')
-rw-r--r-- | src/sg_rtpg.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sg_rtpg.c b/src/sg_rtpg.c index 802a9baa..466c887d 100644 --- a/src/sg_rtpg.c +++ b/src/sg_rtpg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2008 Christophe Varoqui and Douglas Gilbert. + * Copyright (c) 2004-2009 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 20080513"; +static char * version_str = "1.13 20090717"; #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 0x%x ??\n", c); + fprintf(stderr, "unrecognised option code %#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 : 0x%x , Pref=%d\n", + printf(" target port group id : %#x , Pref=%d\n", (ucp[2] << 8) + ucp[3], !!(ucp[0] & 0x80)); printf(" target port group asymmetric access state : "); - printf("0x%02x", ucp[0] & 0x0f); + printf("%#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("0x%02x", ucp[5]); + printf("%#02x", ucp[5]); if (decode) decode_status(ucp[5]); printf("\n"); printf(" vendor unique status : "); - printf("0x%02x\n", ucp[6]); + printf("%#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(" 0x%02x\n", + printf(" %#02x\n", (ucp[8 + j + 2] << 8) + ucp[8 + j + 3]); } off = 8 + j; |