From f494715142cd581b31ec3c9c809986133255ab59 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Mon, 16 Feb 2009 10:41:54 +0100 Subject: Add str_clear(). Same effect as str_init_char(str, ""). --- str.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'str.c') 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 *. */ -- cgit