行数設定とみなされて, その結果行数が設定され直したり意図した行が出ない場合が
あったバグを修正.
{
FILE *fp;
char buf[1024];
- int line, counter, test, numentries;
+ int line, counter, test, numentries = 0;
int line_num = 0;
my_fclose(fp);
return (-1);
}
-
}
-
+
/* Get the number of entries */
while (TRUE)
{
/* Look for the number of entries */
if (isdigit(buf[0]))
{
+ int i;
+ bool digit = TRUE;
+
+ for (i = 1; buf[i] && (buf[i] != '\n') && (buf[i] != '\r'); i++)
+ {
+ if (!isdigit(buf[i]))
+ {
+ digit = FALSE;
+ break;
+ }
+ }
+
/* Get the number of entries */
- numentries = atoi(buf);
- break;
+ if (digit)
+ {
+ numentries = atoi(buf);
+ break;
+ }
}
}
else