Browse Source

ccanlint: always print \n at end of error message.

Brad Hards fixed a two places where score->error was not \n-terminated,
and then I found a few more, so make it automatic.
Rusty Russell 15 years ago
parent
commit
072d358f47
1 changed files with 4 additions and 2 deletions
  1. 4 2
      tools/ccanlint/ccanlint.c

+ 4 - 2
tools/ccanlint/ccanlint.c

@@ -149,8 +149,10 @@ static bool run_test(struct ccanlint *i,
 	}
 
 	if ((!quiet && !score->pass) || verbose) {
-		if (score->error)
-			printf("%s", score->error);
+		if (score->error) {
+			printf("%s%s", score->error,
+			       strends(score->error, "\n") ? "" : "\n");
+		}
 		if (!quiet && !score->pass && i->handle)
 			i->handle(m, score);
 	}