aboutsummaryrefslogtreecommitdiffstats
path: root/xstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'xstring.c')
-rw-r--r--xstring.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/xstring.c b/xstring.c
index 09c6bf3..7dcb5f1 100644
--- a/xstring.c
+++ b/xstring.c
@@ -38,19 +38,14 @@ string *string_nalloc(string *str, const char *text, size_t text_len)
void string_release(string *str)
{
- if(str->s) {
- free(str->s);
- str->s = NULL;
- }
+ free(str->s);
free(str);
}
void string_reset(string *str)
{
- if(str->s) {
- str->s[0] = '\0';
- str->len = 0;
- }
+ str->s[0] = '\0';
+ str->len = 0;
}
static void string_realloc(string *str, int cap)