aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-01-21 11:46:34 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-01-21 11:46:34 +0100
commit822cfd9e33b5bb4b3bc14322424292be043bafef (patch)
treebb2b4451a7602251d7692df5000120d7fe9aba51
parentRemove all explicit malloc's. (diff)
downloadcalp-822cfd9e33b5bb4b3bc14322424292be043bafef.tar.gz
calp-822cfd9e33b5bb4b3bc14322424292be043bafef.tar.xz
Replace some stack allocations with SNEW.
-rw-r--r--parse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/parse.c b/parse.c
index be7e0a6a..a2ceae6a 100644
--- a/parse.c
+++ b/parse.c
@@ -16,8 +16,7 @@
int parse_file(FILE* f, vcalendar* cal) {
int segments = 1;
- strbuf str;
- strbuf_init_1 (&str, segments * SEGSIZE);
+ SNEW(strbuf, str, segments * SEGSIZE);
part_context p_ctx = p_key;
scope_context s_ctx = s_none;
@@ -29,8 +28,7 @@ int parse_file(FILE* f, vcalendar* cal) {
NEW(vevent, ev, /**/ 100);
- content_line cline;
- content_line_init_2 (&cline, keylen, vallen);
+ SNEW(content_line, cline, keylen, vallen);
char c;
while ( (c = fgetc(f)) != EOF) {