summaryrefslogtreecommitdiff
path: root/app/dynstring/dynstring.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
commitdf247efec654e512242e4f4f1b0212034f9e01fe (patch)
tree25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/dynstring/dynstring.c
parentd0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff)
parenta5ade52caa489cf0a713e0f02b764000d203140e (diff)
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterHEADdebian/1%5.2.0Beta2.1-1master
Diffstat (limited to 'app/dynstring/dynstring.c')
-rw-r--r--app/dynstring/dynstring.c17
1 files changed, 17 insertions, 0 deletions
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.