Fix case when no section at top of input file

This fixes issue #13
This commit is contained in:
Elad Salomons
2015-09-20 22:44:31 +03:00
parent bdcf3d77d5
commit f894ade5ee

View File

@@ -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;
}
}