From 097442ed9e3340344d7fbc021baaf0b11e7ea4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 23 Feb 2019 21:19:32 +0100 Subject: Everything broken, again. --- vcal.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vcal.c') diff --git a/vcal.c b/vcal.c index fa0649e6..0e4061c3 100644 --- a/vcal.c +++ b/vcal.c @@ -57,14 +57,16 @@ int DEEP_COPY(vcomponent)(vcomponent* a, vcomponent* b) { return -1; } -content_line::content_line (strbuf* key, strbuf* val) { +content_line::content_line (std::string* key, std::string* val) { this->key = key; this->push_value(val); } -void vcomponent:: push_kv (strbuf* key, strbuf* val) { +void vcomponent:: push_kv (std::string* key, std::string* val) { auto cl = new content_line (key, val); - this->clines.push(key->mem, cl); + char * mem = (char*) malloc(key->length()); + memcpy (mem, key->c_str(), key->length() + 1); + this->clines.push(mem, cl); } #if 0 -- cgit v1.2.3