From 73452ae588e1cebe44676030fb683c8f7e976dea Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 29 May 2014 20:25:03 +1000 Subject: BLI_dynstr: add assert to check curlen is correct --- source/blender/blenlib/intern/BLI_dynstr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to '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 4c712a2f237..25607d8b499 100644 --- a/source/blender/blenlib/intern/BLI_dynstr.c +++ b/source/blender/blenlib/intern/BLI_dynstr.c @@ -34,6 +34,7 @@ #include #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'; } -- cgit v1.2.3