From e5725ae3ffa5401e9c2bac5837335057945d9eed Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Thu, 24 Jun 2004 20:49:56 +0000
Subject: [PATCH] Avoid error adding "*" suffix to partition name with a field
 width of zero.

---
 src/sinfo/print.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sinfo/print.c b/src/sinfo/print.c
index c8a6cde1744..846c3590d54 100644
--- a/src/sinfo/print.c
+++ b/src/sinfo/print.c
@@ -405,7 +405,7 @@ int _print_partition(sinfo_data_t * sinfo_data, int width,
 			if (sinfo_data->part_info->default_part) {
 				if (strlen(tmp) < width)
 					xstrcat(tmp, "*");
-				else
+				else if (width > 0)
 					tmp[width-1] = '*';
 			}
 			_print_str(tmp, width, right_justify, true);
-- 
GitLab