From 7cbea580905b764903b5d0a44c265f9d2a35f17a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 19 Jun 2020 18:22:15 -0400 Subject: [PATCH] fix str_init_dup_str closes #1021 Change-Id: I0354e4b357c159893a91ef9c96560f99a12778d2 --- lib/str.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/str.h b/lib/str.h index dd1f47709..a232b091c 100644 --- a/lib/str.h +++ b/lib/str.h @@ -245,6 +245,7 @@ INLINE str *str_init_dup_str(str *out, const str *s) { out->s = malloc(s->len + 1); memcpy(out->s, s->s, s->len); out->s[s->len] = '\0'; + out->len = s->len; return out; } INLINE void str_free_dup(str *out) {