[Bf-blender-cvs] [be92598] master: Off by one error in own recent commit

Campbell Barton noreply at git.blender.org
Thu Oct 8 10:10:43 CEST 2015


Commit: be92598a85f6014b4b03fc910a192829e1622fef
Author: Campbell Barton
Date:   Thu Oct 8 19:04:33 2015 +1100
Branches: master
https://developer.blender.org/rBbe92598a85f6014b4b03fc910a192829e1622fef

Off by one error in own recent commit

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

M	source/blender/blenlib/intern/storage.c

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

diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 04d5e35..f7a8664 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -93,7 +93,7 @@ char *BLI_current_working_dir(char *dir, const size_t maxncpy)
 	if (pwd) {
 		size_t srclen = BLI_strnlen(pwd, maxncpy);
 		if (srclen != maxncpy) {
-			memcpy(dir, pwd, srclen);
+			memcpy(dir, pwd, srclen + 1);
 			return dir;
 		}
 		else {




More information about the Bf-blender-cvs mailing list