Minor correction to the new "repeat <steps> ... endrepeat" function for

tech files, as the first implementation was repeating one too many
times.  Also:  The wrong type was being read for the number of steps,
although the resulting value was correct.
This commit is contained in:
R. Timothy Edwards 2026-03-02 12:24:46 -05:00
parent ecd6ec56ae
commit 2929ef583e
2 changed files with 6 additions and 4 deletions

View File

@ -1 +1 @@
8.3.612
8.3.613

View File

@ -617,15 +617,17 @@ TechLoad(filename, initmask)
/* "repeat <number>" reads the lines until "endrepeat" <number> times */
else if ((argc == 2) && (!strcmp(argv[0], "repeat")))
{
char *endptr;
repeatcount = (off_t)strtol(argv[1], &endptr, 0);
if (*endptr != '\0')
if (!StrIsInt(argv[1]))
{
TechError("Error: \"repeat\" with invalid count %s\n", argv[1]);
repeatcount = 0;
}
else
{
repeatcount = atoi(argv[1]) - 1;
repeatpos = ftell(fstack->file);
}
continue;
}