summaryrefslogtreecommitdiffstats
path: root/str.c
diff options
context:
space:
mode:
Diffstat (limited to 'str.c')
-rw-r--r--str.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/str.c b/str.c
index c340e73..ee406e3 100644
--- a/str.c
+++ b/str.c
@@ -257,6 +257,15 @@ cleanup:
return result;
}
+void
+str_clear(ld_string_t *dest)
+{
+ REQUIRE(dest != NULL);
+
+ if (dest->allocated)
+ dest->data[0] = '\0';
+}
+
/*
* Initialize string from char *.
*/