Commit b795e129 authored by Daniel Salzman's avatar Daniel Salzman

knot1to2: remove temporary file if successfully reformatted

parent 64fccc1f
......@@ -237,10 +237,14 @@ int main(int argc, char **argv)
// Reformat converted file.
ret = reformat(file_out, file_tmp, path);
free(file_tmp);
if (ret != 0) {
free(file_tmp);
return EXIT_FAILURE;
}
// Remove temporary file if successfully reformatted.
remove(file_tmp);
free(file_tmp);
}
return EXIT_SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment