From b953da22a910faef8ceffd95b615c9433ce02f56 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 22 Oct 2009 11:51:32 -0700 Subject: [PATCH] hexdump: can dump to a buffer --- src/common/debug.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/common/debug.h b/src/common/debug.h index 26d3c9f9100c0..d47861dfa4130 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -86,18 +86,23 @@ inline ostream& operator<<(ostream& out, _bad_endl_use_dendl_t) { #define dendl std::endl; _dout_end_line(); } } while (0) -inline static void hexdump(string msg, const char *s, int len) +inline static void hex2str(const char *s, int len, char *buf, int dest_len) { - int buf_len = len*4; - char buf[buf_len]; int pos = 0; - for (int i=0; i