From 8e8e7f35b71e7aa88f5e45bf1594bcc75526227d Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Wed, 12 Sep 2012 12:15:40 +0300 Subject: [PATCH] Fix zdb printf format string for ZIL data blocks Without this fix the zdb printouts of ZIL data blocks look full of FF due to printf() handling its arguments as int by default. Here is the output before the fix TX_WRITE len 4136, txg 1093817, seq 149231 foid 4242, offset 0, length f68 G FFFFFF8EFFFFFF87FFFFFF91FFFFFFCC 1c FFFFFFAFFFFFFFC9FFFFFFBAZ FFFFFFC3 And the same after the fix TX_WRITE len 4136, txg 1093817, seq 149231 foid 4242, offset 0, length f68 G 8E8791CC 1cAFC9BAZ C3 Signed-off-by: Brian Behlendorf Closes #962 --- cmd/zdb/zdb_il.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/zdb/zdb_il.c b/cmd/zdb/zdb_il.c index 257aa6f4b..bc167cee6 100644 --- a/cmd/zdb/zdb_il.c +++ b/cmd/zdb/zdb_il.c @@ -20,6 +20,7 @@ */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2012 Cyril Plisko. All rights reserved. * Use is subject to license terms. */ @@ -172,7 +173,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr) if (isprint(*data)) (void) printf("%c ", *data); else - (void) printf("%2X", *data); + (void) printf("%2hhX", *data); data++; } (void) printf("\n");