From 9ea42084b3e0a2d960c0e3c9d3e06e371bc2d92b Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Thu, 11 Apr 2019 08:46:38 -0400 Subject: [PATCH] Prevent cache mode to be truncated in case of 'Unknown' mode. Signed-off-by: Michal Mielewczyk --- casadm/cas_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/casadm/cas_lib.c b/casadm/cas_lib.c index 3593e0c..94180d2 100644 --- a/casadm/cas_lib.c +++ b/casadm/cas_lib.c @@ -410,7 +410,7 @@ inline const char *eviction_policy_to_name(uint8_t policy) inline const char *cache_mode_to_name(uint8_t cache_mode) { - return val_to_short_name(cache_mode, cache_mode_names, "Unknown mode"); + return val_to_short_name(cache_mode, cache_mode_names, "Unknown"); } static inline const char *cache_mode_to_name_long(uint8_t cache_mode) @@ -2642,7 +2642,7 @@ int list_caches(unsigned int list_format) char status_buf[CACHE_STATE_LENGHT]; const char *tmp_status; - char mode_string[10]; + char mode_string[12]; float cache_flush_prog; float core_flush_prog;