diff options
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -59,7 +59,7 @@ void strbuf_init(strbuf_t *s, size_t len) | |||
59 | s->reallocs = 0; | 59 | s->reallocs = 0; |
60 | s->debug = 0; | 60 | s->debug = 0; |
61 | 61 | ||
62 | s->buf = malloc(size); | 62 | s->buf = (char *)malloc(size); |
63 | if (!s->buf) | 63 | if (!s->buf) |
64 | die("Out of memory"); | 64 | die("Out of memory"); |
65 | 65 | ||
@@ -70,7 +70,7 @@ strbuf_t *strbuf_new(size_t len) | |||
70 | { | 70 | { |
71 | strbuf_t *s; | 71 | strbuf_t *s; |
72 | 72 | ||
73 | s = malloc(sizeof(strbuf_t)); | 73 | s = (strbuf_t*)malloc(sizeof(strbuf_t)); |
74 | if (!s) | 74 | if (!s) |
75 | die("Out of memory"); | 75 | die("Out of memory"); |
76 | 76 | ||
@@ -169,7 +169,7 @@ void strbuf_resize(strbuf_t *s, size_t len) | |||
169 | } | 169 | } |
170 | 170 | ||
171 | s->size = newsize; | 171 | s->size = newsize; |
172 | s->buf = realloc(s->buf, s->size); | 172 | s->buf = (char *)realloc(s->buf, s->size); |
173 | if (!s->buf) | 173 | if (!s->buf) |
174 | die("Out of memory, len: %zu", len); | 174 | die("Out of memory, len: %zu", len); |
175 | s->reallocs++; | 175 | s->reallocs++; |