diff options
author | Martin Nagy <mnagy@redhat.com> | 2009-02-16 10:41:54 +0100 |
---|---|---|
committer | Martin Nagy <mnagy@redhat.com> | 2009-02-18 18:20:49 +0100 |
commit | f494715142cd581b31ec3c9c809986133255ab59 (patch) | |
tree | 75cee069267673c80fb2ac0dba066f344bda83dc /str.c | |
parent | ffa6b87e86b10b69791f3ac19e47eadefe94da46 (diff) | |
download | ldap_driver_testing-f494715142cd581b31ec3c9c809986133255ab59.tar.gz ldap_driver_testing-f494715142cd581b31ec3c9c809986133255ab59.tar.xz ldap_driver_testing-f494715142cd581b31ec3c9c809986133255ab59.zip |
Add str_clear().
Same effect as str_init_char(str, "").
Diffstat (limited to 'str.c')
-rw-r--r-- | str.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 *. */ |