Fix T44433: print "unknown" rather than "1970-01-01" when .blend date is unknown.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 1 May 2015 13:52:53 +0000 (15:52 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 1 May 2015 17:18:26 +0000 (19:18 +0200)
source/blender/blenloader/intern/readfile.c

index 6d9d7ad073f1c048faa456b5575fa0a77618f677..2aaa84bc056db65e47165207ba2ca3ed09eadcd5 100644 (file)
@@ -7805,12 +7805,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (G.debug & G_DEBUG) {
                char build_commit_datetime[32];
                time_t temp_time = main->build_commit_timestamp;
-               struct tm *tm = gmtime(&temp_time);
+               struct tm *tm = (temp_time) ? gmtime(&temp_time) : NULL;
                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));
+                       BLI_strncpy(build_commit_datetime, "unknown", sizeof(build_commit_datetime));
                }
 
                printf("read file %s\n  Version %d sub %d date %s hash %s\n",