dag

Djmoch's Auto Generator
git clone git://git.danielmoch.com/dag.git
Log | Files | Refs | README | LICENSE

commit 289371e5f275d33e4dc01ff4f4087b76ed5e69ca
parent 487c6ff5a388696a35d1561ced33e9622ce60053
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun, 18 Sep 2022 06:44:39 -0400

dirname may modify input string

Per POSIX, dirname(3) may modify the input string, so pass it one we
don't plan to use again.

Diffstat:
Mdagfile.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dagfile.c b/dagfile.c @@ -260,7 +260,9 @@ make_outpath(const char *file) } } - dag_mkdir(dirname(target)); + char *tt = strdup(target); + dag_mkdir(dirname(tt)); + free(tt); if (verbose >= 2) { printf("make_outpath(%s) = %s\n", file, target); }