From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/dynstring/dynstring.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/dynstring/dynstring.c') diff --git a/app/dynstring/dynstring.c b/app/dynstring/dynstring.c index eb7b2c5..fd50a0b 100644 --- a/app/dynstring/dynstring.c +++ b/app/dynstring/dynstring.c @@ -115,6 +115,23 @@ void DynStringClear(DynString *s) DynStringRealloc(s); } + +/** +* Clear the dynamic string contents without changing memory allocation. +* +* \param s IN the dynamic string +*/ + +void DynStringReset(DynString *s) +{ + /* Not a string? */ + if (isnas(s)) + { + return; + } + s->size = 0; +} + /** * Resize the string for a minimum number of bytes. In order to optimize memory usage the * actually allocated block of memory can be larger than the requested size. -- cgit v1.2.3