From: sgerwk <sgerwk@aol.com>
Date: Sat, 28 Oct 2017 07:14:44 +0000 (+0200)
Subject: print format for flags
X-Git-Tag: cronie-1.5.2~11
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc19b51f5ac10d2b60f288f5490772c4a89d66d6;p=cronie

print format for flags
---

diff --git a/src/cronnext.c b/src/cronnext.c
index e5d743c..519980f 100644
--- a/src/cronnext.c
+++ b/src/cronnext.c
@@ -76,10 +76,14 @@ char *flagname[]= {
 
 void printflags(int flags) {
 	int f;
+	int first = 1;
+
 	printf("flags: 0x%d = ", flags);
 	for (f = 1; f < sizeof(flagname);  f = f << 1)
-		if (flags & f)
-			printf("%s ", flagname[f]);
+		if (flags & f) {
+			printf("%s%s", first ? " " : "|", flagname[f]);
+			first = 0;
+		}
 	printf("\n");
 }