From f894ade5eea19fbae121188974ada4db125bf8b1 Mon Sep 17 00:00:00 2001 From: Elad Salomons Date: Sun, 20 Sep 2015 22:44:31 +0300 Subject: [PATCH] Fix case when no section at top of input file This fixes issue #13 --- src/input2.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/input2.c b/src/input2.c index 6ac3202..aa03cdc 100755 --- a/src/input2.c +++ b/src/input2.c @@ -218,11 +218,19 @@ int readdata() /* Otherwise process next line of input in current section */ else { - inperr = newline(sect,line); - if (inperr > 0) + if (sect >=0) //for cases were no section is present on the top of the input file { - inperrmsg(inperr,sect,line); - errsum++; + inperr = newline(sect,line); + if (inperr > 0) + { + inperrmsg(inperr,sect,line); + errsum++; + } + } + else + { + errcode = 200; + break; } }