X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbootchart%2Fbootchart.c;h=813e38deeb0afc34f1827aa8a2092692bf8c34b0;hb=6357ac664c9ce8ae5b83bdb98011da24185e4efa;hp=8ef5ad18a6ac742609fa83b1cd84098e6a77efe1;hpb=4155f7d4be5053d5f34a26e5437fd85e1fe00fa3;p=elogind.git diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 8ef5ad18a..813e38dee 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -389,7 +389,9 @@ int main(int argc, char *argv[]) { if (!of && (access(arg_output_path, R_OK|W_OK|X_OK) == 0)) { t = time(NULL); - strftime(datestr, sizeof(datestr), "%Y%m%d-%H%M", localtime(&t)); + r = strftime(datestr, sizeof(datestr), "%Y%m%d-%H%M", localtime(&t)); + assert_se(r > 0); + snprintf(output_file, PATH_MAX, "%s/bootchart-%s.svg", arg_output_path, datestr); of = fopen(output_file, "we"); } @@ -457,7 +459,9 @@ int main(int argc, char *argv[]) { if (!of) { t = time(NULL); - strftime(datestr, sizeof(datestr), "%Y%m%d-%H%M", localtime(&t)); + r = strftime(datestr, sizeof(datestr), "%Y%m%d-%H%M", localtime(&t)); + assert_se(r > 0); + snprintf(output_file, PATH_MAX, "%s/bootchart-%s.svg", arg_output_path, datestr); of = fopen(output_file, "we"); } @@ -467,7 +471,7 @@ int main(int argc, char *argv[]) { exit (EXIT_FAILURE); } - svg_do(build); + svg_do(strna(build)); fprintf(stderr, "systemd-bootchart wrote %s\n", output_file);