ccanlint: always print \n at end of error message.
authorRusty Russell <rusty@rustcorp.com.au>
Sat, 22 Jan 2011 02:02:54 +0000 (12:32 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sat, 22 Jan 2011 02:02:54 +0000 (12:32 +1030)
Brad Hards fixed a two places where score->error was not \n-terminated,
and then I found a few more, so make it automatic.

tools/ccanlint/ccanlint.c

index 15d131e20073c2106ec2963d07a2ed76c5492730..1c7ee389dbc75728d35091e23a7d0c5a4463a469 100644 (file)
@@ -149,8 +149,10 @@ static bool run_test(struct ccanlint *i,
        }
 
        if ((!quiet && !score->pass) || verbose) {
        }
 
        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);
        }
                if (!quiet && !score->pass && i->handle)
                        i->handle(m, score);
        }