]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/examples_run.c
tdb2: tdb_error()
[ccan] / tools / ccanlint / tests / examples_run.c
index 077ea2487b431a1f365702f94b9ff4f78473df5d..23a3844a5bb7d0d153bb2f55cb638107e77b3a79 100644 (file)
@@ -36,10 +36,10 @@ static bool scan_forv(const void *ctx,
 
        va_copy(ap, *args);
 
-       if (isspace(fmt[0])) {
+       if (cisspace(fmt[0])) {
                /* One format space can swallow many input spaces */
                ret = false;
-               while (isspace(input[0])) {
+               while (cisspace(input[0])) {
                        if (scan_forv(ctx, ++input, fmt+1, &ap)) {
                                ret = true;
                                break;
@@ -247,24 +247,20 @@ static void run_examples(struct manifest *m, bool keep,
                             linenum++,
                                     expect = find_expect(i, lines, &input,
                                                          &exact, &linenum)) {
-                               char *err;
-                               score->total++;
                                if (i->compiled == NULL)
                                        continue;
 
+                               score->total++;
                                output = unexpected(i, input, expect, exact);
                                if (!output) {
                                        score->score++;
                                        continue;
                                }
-                               err = talloc_asprintf(score,
-                                                     "output '%s' didn't"
-                                                     " %s '%s'\n",
-                                                     output,
-                                                     exact
-                                                     ? "match" : "contain",
-                                                     expect);
-                               score_file_error(score, i, linenum+1, err);
+                               score_file_error(score, i, linenum+1,
+                                                "output '%s' didn't %s '%s'\n",
+                                                output,
+                                                exact ? "match" : "contain",
+                                                expect);
                                score->pass = false;
                        }
                }