From d40f2b204b78ace5c2c9c3007887571ca5a2ec11 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 8 Nov 2005 12:50:11 +0000 Subject: Added ENABLE_INLINE_FILES feature. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@784 e7ae566f-a301-0410-adde-c780ea21d3b5 --- buffer.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index cfff06e..3b856bc 100644 --- a/buffer.c +++ b/buffer.c @@ -460,6 +460,20 @@ string_alloc (const char *str, struct gc_arena *gc) return NULL; } +/* + * 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 */ -- cgit