X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbootchart%2Fbootchart.c;h=366a5ab5d0225b5d34ae68cfaba96cf9433974ab;hp=8ef5ad18a6ac742609fa83b1cd84098e6a77efe1;hb=e931d3f4241231e4102eda06adaf7cbfd68c6a5d;hpb=9bcf7507fab6e6b022ae3cc7178237e6e0a09e9a diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 8ef5ad18a..366a5ab5d 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"); }