aboutsummaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index cfff06e..3b856bc 100644
--- a/buffer.c
+++ b/buffer.c
@@ -461,6 +461,20 @@ string_alloc (const char *str, struct gc_arena *gc)
}
/*
+ * Erase all characters in a string
+ */
+void
+string_clear (char *str)
+{
+ if (str)
+ {
+ const int len = strlen (str);
+ if (len > 0)
+ memset (str, 0, len);
+ }
+}
+
+/*
* Allocate a string inside a buffer
*/
struct buffer