From e4bb59293be826bd96c044e19e2fd1ad9cf892cb Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Fri, 21 Aug 2009 21:20:45 +0000 Subject: [PATCH] svn merge -r18487:18490 https://eris.llnl.gov/svn/slurm/branches/slurm-2.0 --- src/common/slurm_protocol_api.c | 5 ++++- src/sview/popups.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index 76148bf775b..45af8722f91 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -3503,7 +3503,10 @@ extern void convert_num_unit(float num, char *buf, int buf_size, int orig_type) char *unit = "\0KMGP?"; int i = (int)num % 512; - if((i > 0) || (int)num == 0) { + if((int)num == 0) { + snprintf(buf, buf_size, "%d", (int)num); + return; + } else if(i > 0) { snprintf(buf, buf_size, "%d%c", (int)num, unit[orig_type]); return; } diff --git a/src/sview/popups.c b/src/sview/popups.c index 8a876e86c5c..1c279c62479 100644 --- a/src/sview/popups.c +++ b/src/sview/popups.c @@ -292,8 +292,9 @@ static void _layout_ctl_conf(GtkTreeStore *treestore, add_display_treestore_line_with_font( update, treestore, &iter, "Configuration data as of", temp_str, "bold"); - snprintf(temp_str, sizeof(temp_str), "%u", - slurm_ctl_conf_ptr->accounting_storage_enforce); + accounting_enforce_string( + slurm_ctl_conf_ptr->accounting_storage_enforce, + temp_str, sizeof(temp_str)); add_display_treestore_line(update, treestore, &iter, "AccountingStorageEnforce", temp_str); -- GitLab