From f367905bef39191791f83c4744b424fedb89d976 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Tue, 17 Jan 2006 17:30:29 +0000 Subject: [PATCH] fix Unknown display for val2str() --- ipmitool/lib/helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipmitool/lib/helper.c b/ipmitool/lib/helper.c index b35a61e..ee40966 100644 --- a/ipmitool/lib/helper.c +++ b/ipmitool/lib/helper.c @@ -110,7 +110,7 @@ void printbuf(const uint8_t * buf, int len, const char * desc) const char * val2str(uint16_t val, const struct valstr *vs) { - static char un_str[16]; + static char un_str[32]; int i; for (i = 0; vs[i].str != NULL; i++) { @@ -118,8 +118,8 @@ const char * val2str(uint16_t val, const struct valstr *vs) return vs[i].str; } - memset(un_str, 0, 16); - snprintf(un_str, 16, "Unknown (0x%02x)", val); + memset(un_str, 0, 32); + snprintf(un_str, 32, "Unknown (0x%x)", val); return un_str; }