[Bf-blender-cvs] [73452ae] master: BLI_dynstr: add assert to check curlen is correct

Campbell Barton noreply at git.blender.org
Thu May 29 12:40:07 CEST 2014


Commit: 73452ae588e1cebe44676030fb683c8f7e976dea
Author: Campbell Barton
Date:   Thu May 29 20:25:03 2014 +1000
https://developer.blender.org/rB73452ae588e1cebe44676030fb683c8f7e976dea

BLI_dynstr: add assert to check curlen is correct

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

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

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

diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index 4c712a2..25607d8 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -34,6 +34,7 @@
 #include <string.h>
 
 #include "MEM_guardedalloc.h"
+#include "BLI_utildefines.h"
 #include "BLI_string.h"
 #include "BLI_dynstr.h"
 
@@ -237,6 +238,7 @@ void BLI_dynstr_get_cstring_ex(DynStr *ds, char *rets)
 
 		s += slen;
 	}
+	BLI_assert((s - rets) == ds->curlen);
 	rets[ds->curlen] = '\0';
 }




More information about the Bf-blender-cvs mailing list