[Bf-blender-cvs] [4a641e3] master: Cycles: Fix corner case of human readable number returning empty string

Sergey Sharybin noreply at git.blender.org
Mon Jun 27 10:50:40 CEST 2016


Commit: 4a641e3cbc3bb57af42672bbf243a6af382eb5a0
Author: Sergey Sharybin
Date:   Mon Jun 27 13:49:25 2016 +0500
Branches: master
https://developer.blender.org/rB4a641e3cbc3bb57af42672bbf243a6af382eb5a0

Cycles: Fix corner case of human readable number returning empty string

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

M	intern/cycles/util/util_string.cpp

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

diff --git a/intern/cycles/util/util_string.cpp b/intern/cycles/util/util_string.cpp
index e16a83d..c1c5a6b 100644
--- a/intern/cycles/util/util_string.cpp
+++ b/intern/cycles/util/util_string.cpp
@@ -260,7 +260,11 @@ string string_human_readable_size(size_t size)
 
 string string_human_readable_number(size_t num)
 {
-	/* add thousands separators */
+	if(num == 0) {
+		return "0";
+	}
+
+	/* Add thousands separators. */
 	char buf[32];
 
 	char* p = buf+31;




More information about the Bf-blender-cvs mailing list