]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/examples_relevant.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / tools / ccanlint / tests / examples_relevant.c
index 283e78c10cda3914ce3ccaaad328c31be94d5f89..1fc1f3bb67a21fe795916f91fa00e8f9543eb223 100644 (file)
@@ -1,6 +1,5 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
-#include <ccan/talloc/talloc.h>
 #include <ccan/str/str.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -15,8 +14,7 @@
 #include <ctype.h>
 
 static void examples_relevant_check(struct manifest *m,
-                                   bool keep,
-                                   unsigned int *timeleft,
+                                   unsigned int *timeleft UNNEEDED,
                                    struct score *score)
 {
        struct ccan_file *f;
@@ -30,6 +28,11 @@ static void examples_relevant_check(struct manifest *m,
                        if (!streq(d->type, "example"))
                                continue;
 
+                       if (!d->function) {
+                               score_file_error(score, f, d->srcline+1,
+                                                "Function name not found in summary line");
+                               continue;
+                       }
                        for (i = 0; i < d->num_lines; i++) {
                                if (strstr(d->lines[i], d->function))
                                        found = true;