>From a34318a3f968d828e5f630763464f2623a435bef Mon Sep 17 00:00:00 2001
From: Pero Brbora
Date: Wed, 25 Mar 2015 00:42:23 +0100
Subject: [PATCH] Fix segfault when runing program without input arguments.
---
examples/testsvg2.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/examples/testsvg2.c b/examples/testsvg2.c
index 1a00812..bd6aacd 100644
--- a/examples/testsvg2.c
+++ b/examples/testsvg2.c
@@ -25,7 +25,7 @@
#include
#include
//#include "../src/bits.h"
-//#include "suffix.c"
+#include "suffix.c"
double model_xmin, model_ymin;
double page_width, page_height, scale;
@@ -47,7 +47,7 @@ output_SVG(dwg_data* dwg);
int
main(int argc, char *argv[])
{
-// REQUIRE_INPUT_FILE_ARG (argc);
+ REQUIRE_INPUT_FILE_ARG (argc);
return test_SVG (argv[1]);
}
@@ -62,9 +62,8 @@ test_SVG(char *filename)
if (!error)
{
output_SVG(&dwg);
+ dwg_free(&dwg);
}
-
- dwg_free(&dwg);
/* This value is the return value for `main',
so clamp it to either 0 or 1. */
return error ? 1 : 0;
--
1.9.1