+static void write_file(const char *name, const uint8_t *fingerprint,
+ const char *prefix, char *buf)
+{
+ FILE *f;
+
+ f = open_file(name, false);
+ fputs("untrusted comment: ", f);
+ if (comment)
+ fputs(comment, f);
+ else
+ fprintf(f, "%s %"PRIx64, prefix,
+ fingerprint_u64(fingerprint));
+ fprintf(f, "\n%s\n", buf);
+ fclose(f);
+}
+