utf8: don't allow NUL in decoded strings.
[ccan] / tools / ccanlint / tests / depends_build_without_features.c
index dfa96d72c0fe3d0704a86ae244aef7c57af82b91..cacb5002532c8f8f0e8b39c4d7bb39956f722c57 100644 (file)
@@ -1,7 +1,7 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
-#include <ccan/talloc/talloc.h>
 #include <ccan/str/str.h>
+#include <ccan/foreach/foreach.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -16,7 +16,7 @@
 #include "reduce_features.h"
 #include "build.h"
 
-static const char *can_build(struct manifest *m)
+static const char *can_build(struct manifest *m UNNEEDED)
 {
        if (safe_mode)
                return "Safe mode enabled";
@@ -24,25 +24,28 @@ static const char *can_build(struct manifest *m)
 }
 
 static void check_depends_built_without_features(struct manifest *m,
-                                                bool keep,
-                                                unsigned int *timeleft,
+                                                unsigned int *timeleft UNNEEDED,
                                                 struct score *score)
 {
+       struct list_head *list;
        struct manifest *i;
        char *flags;
 
-       flags = talloc_asprintf(score, "%s %s", cflags,
-                               REDUCE_FEATURES_FLAGS);
+       flags = tal_fmt(score, "%s %s", cflags, REDUCE_FEATURES_FLAGS);
 
-       list_for_each(&m->deps, i, list) {
-               char *errstr = build_submodule(i, flags, COMPILE_NOFEAT);
+       foreach_ptr(list, &m->deps, &m->test_deps) {
+               list_for_each(list, i, list) {
+                       char *errstr = build_submodule(i, flags,
+                                                      COMPILE_NOFEAT);
 
-               if (errstr) {
-                       score->error = talloc_asprintf(score,
+                       if (errstr) {
+                               score->error = tal_fmt(score,
                                                       "Dependency %s"
                                                       " did not build:\n%s",
-                                                      i->basename, errstr);
-                       return;
+                                                      i->modname,
+                                                      errstr);
+                               return;
+                       }
                }
        }