X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Finfo_exists.c;h=9f6f2066ddf90dc5d0149f68ee62827ae7d2f3cd;hp=330749ba46af0e076f91916c15cd6b4860a5b0e1;hb=291237b4fed863be74051274ac5ad9920cb33cc3;hpb=af5b1a18948345c5f9f9abf4eda3ab9fe0aa9a9f diff --git a/tools/ccanlint/tests/info_exists.c b/tools/ccanlint/tests/info_exists.c index 330749ba..9f6f2066 100644 --- a/tools/ccanlint/tests/info_exists.c +++ b/tools/ccanlint/tests/info_exists.c @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -10,7 +12,6 @@ #include #include #include -#include static void check_has_info(struct manifest *m, unsigned int *timeleft, @@ -21,7 +22,7 @@ static void check_has_info(struct manifest *m, score->score = score->total; add_info_options(m->info_file); } else { - score->error = talloc_strdup(score, + score->error = tal_strdup(score, "You have no _info file.\n\n" "The file _info contains the metadata for a ccan package: things\n" "like the dependencies, the documentation for the package as a whole\n" @@ -30,8 +31,9 @@ static void check_has_info(struct manifest *m, } static const char template[] = - "#include \n" "#include \"config.h\"\n" + "#include \n" + "#include \n" "\n" "/**\n" " * %s - YOUR-ONE-LINE-DESCRIPTION-HERE\n" @@ -63,12 +65,12 @@ static void create_info_template(struct manifest *m, struct score *score) if (!ask("Should I create a template _info file for you?")) return; - filename = talloc_asprintf(m, "%s/%s", m->dir, "_info"); + filename = tal_fmt(m, "%s/%s", m->dir, "_info"); info = fopen(filename, "w"); if (!info) err(1, "Trying to create a template _info in %s", filename); - if (fprintf(info, template, m->basename) < 0) { + if (fprintf(info, template, m->modname) < 0) { unlink_noerr(filename); err(1, "Writing template into %s", filename); }