From 6b8a3ee55815f3a797fd1ca22e199159074f9eba Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 22 Feb 2005 17:20:53 +0000
Subject: [PATCH] Fix squeue output format for "%s" (node select data).

---
 NEWS                     | 1 +
 src/common/node_select.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 77c66e64adc..2b302e83a66 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ documents those changes that are of interest to users and admins.
  -- Don't display any completed jobs in smap.
  -- Add NodeCnt to filetxt job completion plugin.
  -- Minor restructuring of how MMCS is polled for DOWN nodes and switches.
+ -- Fix squeue output format for "%s" (node select data).
 
 * Changes in SLURM 0.4.4
 ========================
diff --git a/src/common/node_select.c b/src/common/node_select.c
index 92267a6c65f..983a66b715d 100644
--- a/src/common/node_select.c
+++ b/src/common/node_select.c
@@ -607,7 +607,12 @@ extern char *select_g_sprint_jobinfo(select_jobinfo_t jobinfo,
 		return NULL;
 	}
 
-	if (jobinfo->geometry[0] == (uint16_t) NO_VAL) {
+	if (jobinfo == NULL) {
+		if (mode != SELECT_PRINT_HEAD) {
+			error("select_g_sprint_jobinfo: jobinfo bad");
+			return NULL;
+		}
+	} else if (jobinfo->geometry[0] == (uint16_t) NO_VAL) {
 		for (i=0; i<SYSTEM_DIMENSIONS; i++)
 			geometry[i] = 0;
 	} else {
-- 
GitLab