about summary refs log tree commit diff
path: root/Src/Modules/parameter.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Modules/parameter.c')
-rw-r--r--Src/Modules/parameter.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index abe7cacd9..640f784c7 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -1223,13 +1223,12 @@ scanpmjobtexts(HashTable ht, ScanFunc func, int flags)
     for (job = 1; job < MAXJOB; job++) {
 	if (jobtab[job].stat && jobtab[job].procs &&
 	    !(jobtab[job].stat & STAT_NOPRINT)) {
+	    sprintf(buf, "%d", job);
+	    pm.nam = dupstring(buf);
 	    if (func != scancountparams &&
 		((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
-		 !(flags & SCANPM_WANTKEYS))) {
-		sprintf(buf, "%d", job);
-		pm.nam = dupstring(buf);
+		 !(flags & SCANPM_WANTKEYS)))
 		pm.u.str = pmjobtext(job);
-	    }
 	    func((HashNode) &pm, flags);
 	}
     }
@@ -1329,13 +1328,12 @@ scanpmjobstates(HashTable ht, ScanFunc func, int flags)
     for (job = 1; job < MAXJOB; job++) {
 	if (jobtab[job].stat && jobtab[job].procs &&
 	    !(jobtab[job].stat & STAT_NOPRINT)) {
+	    sprintf(buf, "%d", job);
+	    pm.nam = dupstring(buf);
 	    if (func != scancountparams &&
 		((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
-		 !(flags & SCANPM_WANTKEYS))) {
-		sprintf(buf, "%d", job);
-		pm.nam = dupstring(buf);
+		 !(flags & SCANPM_WANTKEYS)))
 		pm.u.str = pmjobstate(job);
-	    }
 	    func((HashNode) &pm, flags);
 	}
     }