From 985ed6cd2bd04aef5254d70e9bc870eb08b7d27f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 12 May 2019 04:47:27 +0200 Subject: [PATCH] Small cleanups --- libretro-common/file/file_path.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index bf3a280d19..f8e5709424 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -592,10 +592,11 @@ void fill_pathname_parent_dir(char *out_dir, void fill_dated_filename(char *out_filename, const char *ext, size_t size) { - time_t cur_time = time(NULL); + time_t cur_time = time(NULL); + const struct tm* tm_ = localtime(&cur_time); strftime(out_filename, size, - "RetroArch-%m%d-%H%M%S", localtime(&cur_time)); + "RetroArch-%m%d-%H%M%S", tm_); strlcat(out_filename, ext, size); } @@ -616,11 +617,11 @@ void fill_str_dated_filename(char *out_filename, const char *in_str, const char *ext, size_t size) { char format[256]; - time_t cur_time = time(NULL); + time_t cur_time = time(NULL); + const struct tm* tm_ = localtime(&cur_time); - format[0] = '\0'; - - strftime(format, sizeof(format), "-%y%m%d-%H%M%S.", localtime(&cur_time)); + format[0] = '\0'; + strftime(format, sizeof(format), "-%y%m%d-%H%M%S.", tm_); fill_pathname_join_concat_noext(out_filename, in_str, format, ext,