From 683fa16903e1816b787f14743643a041dfa6a8e2 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 22 Oct 2014 08:20:31 -0400 Subject: [PATCH] Fixed failing code generation test --- source/sclpl/codegen.c | 3 +-- source/sclpl/main.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/sclpl/codegen.c b/source/sclpl/codegen.c index 31d2865..9fe250e 100644 --- a/source/sclpl/codegen.c +++ b/source/sclpl/codegen.c @@ -215,9 +215,8 @@ static void emit_fn_definitions(FILE* file, vec_t* fnlst) { emit_expression(file, fnlst, (tree_t*)vec_at(body,i), 1); fprintf(file, ";\n"); } - fputs("}\n", file); + fputs("}\n\n", file); } - fputs("\n", file); } static void emit_toplevel(FILE* file, vec_t* fnlst, vec_t* prgrm) { diff --git a/source/sclpl/main.c b/source/sclpl/main.c index 0b92afa..5302121 100644 --- a/source/sclpl/main.c +++ b/source/sclpl/main.c @@ -183,7 +183,8 @@ int translate(str_t* in, str_t* out) { fclose(input); fclose(output); - mem_release(out); + if (NULL != out) + mem_release(out); return ret; } -- 2.55.0