diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-23 21:19:32 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-23 21:19:32 +0100 |
commit | 097442ed9e3340344d7fbc021baaf0b11e7ea4fb (patch) | |
tree | e86018252bff6a8a9ac5ae2942845ccbb6ba02db /vcal.c | |
parent | Vill inte. (diff) | |
download | calp-c++2.tar.gz calp-c++2.tar.xz |
Everything broken, again.c++2
Diffstat (limited to 'vcal.c')
-rw-r--r-- | vcal.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |