[Bf-blender-cvs] [4e40bdd] master: Fix T44433: print "unknown" rather than "1970-01-01" when .blend date is unknown.

Brecht Van Lommel noreply at git.blender.org
Fri May 1 19:23:13 CEST 2015


Commit: 4e40bdd02cd97ff61a62512e548686aad0d91a4d
Author: Brecht Van Lommel
Date:   Fri May 1 15:52:53 2015 +0200
Branches: master
https://developer.blender.org/rB4e40bdd02cd97ff61a62512e548686aad0d91a4d

Fix T44433: print "unknown" rather than "1970-01-01" when .blend date is unknown.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 6d9d7ad..2aaa84b 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -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",




More information about the Bf-blender-cvs mailing list