]> git.ozlabs.org Git - ccan/blobdiff - tools/namespacize.c
config.h: idempotent-wrap the generated config.h
[ccan] / tools / namespacize.c
index 77269aac317dac5a4d7c7b319aa794472739f116..5ac85f502f2abb0f5cc9cea1d583c68fdf5546d0 100644 (file)
@@ -406,7 +406,7 @@ static void setup_adjust_files(const char *dir,
 static void rename_files(const struct adjusted *adj)
 {
        while (adj) {
-               if (rename(adj->tmpfile, adj->file) != 0)
+               if (!move_file(adj->tmpfile, adj->file))
                        warn("Could not rename over '%s', we're in trouble",
                             adj->file);
                adj = adj->next;
@@ -445,7 +445,7 @@ static struct replace *read_replacement_file(const char *depdir)
                return NULL;
        }
 
-       for (line = strsplit(file, file, "\n", NULL); *line; line++)
+       for (line = strsplit(file, file, "\n"); *line; line++)
                add_replace(&repl, *line);
        return repl;
 }