Browse Source

Do not print line number in debug messages

The line number does not add any significant information, and it makes
the unit tests which check for these debug messages very fragile.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Matthias Schiffer 3 years ago
parent
commit
00b921d80a
2 changed files with 6 additions and 6 deletions
  1. 2 2
      tests/cram/test_ucert.t
  2. 4 4
      ucert.c

+ 2 - 2
tests/cram/test_ucert.t

@@ -57,9 +57,9 @@ check that ucert is producing expected results:
   ---
 
   $ ucert -D -c $TEST_INPUTS/invalid.ucert
-  cert_dump(406): cannot parse cert
+  cert_dump: cannot parse cert
   [1]
 
   $ ucert-san -D -c $TEST_INPUTS/invalid.ucert
-  cert_dump(406): cannot parse cert
+  cert_dump: cannot parse cert
   [1]

+ 4 - 4
ucert.c

@@ -49,10 +49,10 @@ static enum {
 
 static bool quiet;
 #ifndef UCERT_STRIP_MESSAGES
-#define DPRINTF(format, ...)									\
-	do {											\
-		if (!quiet)									\
-			fprintf(stderr, "%s(%d): " format, __func__, __LINE__, ## __VA_ARGS__);	\
+#define DPRINTF(format, ...)								\
+	do {										\
+		if (!quiet)								\
+			fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__);	\
 	} while (0)
 #else
 #define DPRINTF(format, ...) do { } while (0)