Commit d87f4cd7 authored by David Gobbi's avatar David Gobbi

Add error print to vtkParseHierarchy

Previously this utility would silently call exit(1) if there was
an error while reading the file.  Now it prints a line number.
parent 368bd85c
......@@ -298,6 +298,7 @@ static int vtkParseHierarchy_ReadFileIntoInfo(
unsigned int bits, pointers;
static const char *delims = ">,=";
int success = 1;
int lineno;
fp = fopen(filename, "r");
......@@ -309,7 +310,7 @@ static int vtkParseHierarchy_ReadFileIntoInfo(
line = (char *)malloc(maxlen);
while (fgets(line, (int)maxlen, fp))
for (lineno = 1; fgets(line, (int)maxlen, fp); lineno++)
{
n = strlen(line);
......@@ -648,6 +649,7 @@ static int vtkParseHierarchy_ReadFileIntoInfo(
if (!feof(fp))
{
fprintf(stderr, "%s:%d: error: <unspecified>.\n", filename, lineno);
success = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment