From 40fce431f01439cf8d8459a265054e92808a76f0 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Mon, 4 Apr 2011 15:05:52 -0400 Subject: [PATCH] adding print_hexbuf_no_asci without asci content --- daemon/daemon_debug.c | 14 ++++++++++++++ daemon/daemon_debug.h | 1 + 2 files changed, 15 insertions(+) diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c index 0cf4334..36f6287 100644 --- a/daemon/daemon_debug.c +++ b/daemon/daemon_debug.c @@ -109,6 +109,20 @@ void print_hexbuf(int level, unsigned char *title, unsigned char *buf, int len) fprintf(dlog_file, "\n"); } +void print_hexbuf_no_asci(int level, unsigned char *title, unsigned char *buf, int len) +{ + int j, k; + if (level > g_debug_level) return; + fprintf(dlog_file, "%s", title); + for(j = 0, k = 0; j < len; j++, k++) { + fprintf(dlog_file, "%02x ", buf[j]); + if (((k+1) % 10 == 0 && k > 0)) { + fprintf(dlog_file, "\n"); + } + } + fprintf(dlog_file, "\n"); +} + void print_create_attributes(int level, DWORD create_opts) { if (level > g_debug_level) return; fprintf(dlog_file, "create attributes: "); diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h index 6c5a13b..7ca72b2 100644 --- a/daemon/daemon_debug.h +++ b/daemon/daemon_debug.h @@ -41,6 +41,7 @@ void set_debug_level(int level); void dprintf(int level, LPCSTR format, ...); void eprintf(LPCSTR format, ...); +void print_hexbuf_no_asci(int on, unsigned char *title, unsigned char *buf, int len); void print_hexbuf(int level, unsigned char *title, unsigned char *buf, int len); void print_create_attributes(int level, DWORD create_opts); void print_disposition(int level, DWORD disposition);