diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-19 02:31:35 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-19 10:18:31 +0100 |
commit | 6f3c772939463c97a4a8a8371db42b8f4b181c68 (patch) | |
tree | f8010e9e49696505e22cd0dff3bd84089392a240 /strbuf.cpp | |
parent | I somehow got stuff to bulid, now it just doesn't link. (diff) | |
download | calp-6f3c772939463c97a4a8a8371db42b8f4b181c68.tar.gz calp-6f3c772939463c97a4a8a8371db42b8f4b181c68.tar.xz |
No idea, to tired.
Diffstat (limited to '')
-rw-r--r-- | strbuf.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2,6 +2,12 @@ #include <cstdlib> +strbuf::strbuf (const strbuf& other) { + this->alloc = other.len + 1; + this->mem = static_cast<char*>(malloc(this->alloc)); + strncpy(this->mem, other.mem, other.len); +} + void strbuf::realloc (size_t len) { this->mem = static_cast<char*>(std::realloc(this->mem, len)); this->alloc = len; |