diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-17 19:39:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-17 19:41:28 +0400 |
commit | 84c30edbdfe00bc3b8f39504c4dff5ab607f3ece (patch) | |
tree | 0e7da21d1a68a8a90beee05f64665d62f46a2cb8 /source/blender/blenloader/intern | |
parent | b764fe58c575c7c9343f635cc0cf7836c2a4e14b (diff) |
fix for crash with new buildinfo, when gmtime() returns NULL
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e2876317e38..01a71cfd63d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7932,7 +7932,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) char build_commit_datetime[32]; time_t temp_time = main->build_commit_timestamp; struct tm *tm = gmtime(&temp_time); - strftime(build_commit_datetime, sizeof(build_commit_datetime), "%Y-%m-%d %H:%M", tm); + if (LIKELY(tm)) { + strftime(build_commit_datetime, sizeof(build_commit_datetime), "%Y-%m-%d %H:%M", tm); + } + else { + BLI_strncpy(build_commit_datetime, "date-unknown", sizeof(build_commit_datetime)); + } printf("read file %s\n Version %d sub %d date %s hash %s\n", fd->relabase, main->versionfile, main->subversionfile, |