diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-22 14:32:21 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-22 14:32:21 +0100 |
commit | f618b5d018983f67714161bd515e2c9e11765e33 (patch) | |
tree | 1de04908dfea4dc0c61209a237996f27a0c5b6f0 | |
parent | Build, but doesn't link. (diff) | |
download | calp-f618b5d018983f67714161bd515e2c9e11765e33.tar.gz calp-f618b5d018983f67714161bd515e2c9e11765e33.tar.xz |
strbuf
-rw-r--r-- | strbuf.c | 8 | ||||
-rw-r--r-- | strbuf.h | 6 |
2 files changed, 7 insertions, 7 deletions
@@ -13,10 +13,10 @@ /* * Giving len < 1 is an error. */ -//INIT_F(strbuf, size_t len) { -strbuf::strbuf (size_t len) { - this->mem = (char*) calloc(sizeof(*this->mem), len); - this->alloc = len; +// INIT_F(strbuf, size_t len) { +strbuf::strbuf () { + this->mem = (char*) calloc(sizeof(*this->mem), 2); + this->alloc = 2; this->ptr = 0; this->len = 0; } @@ -16,12 +16,12 @@ struct strbuf { char* mem; /* TODO add support for negative ptr */ int ptr; - unsigned int alloc; + unsigned int alloc = 0; unsigned int len; - strbuf (size_t len); + // strbuf (size_t len); strbuf (strbuf& other); - strbuf () : strbuf (1) { }; + strbuf (); ~strbuf (); |