Corrected two "extresist" issues: (1) Prevent a segfault when

reading a resistor device which uses the syntax where the resistor
is given a value directly and not as a parameter;  (2) allow the
use of "extresist minres 0" (allow resistors in the output no
matter how small).  Thanks to Torleif Skaar for finding the issue
with the resistor syntax.
This commit is contained in:
R. Timothy Edwards 2026-06-23 19:41:53 -04:00
parent 06f0ce4259
commit 3b272cc8d2
2 changed files with 5 additions and 3 deletions

View File

@ -800,9 +800,11 @@ ResReadDevice(int argc,
* be simpler if all devices just put "None" in this position.
*/
n = argc - i;
if ((n % 3) == 1) /* Device has a substrate argument */
if ((n % 3) == 1)
{
if (strcmp(argv[i], "None"))
/* Device has a substrate argument or a numerical value */
if (strcmp(argv[i], "None") && (!StrIsNumeric(argv[i])))
{
entry = HashFind(&ResNodeTable, argv[i]);
device->subs = (ResExtNode *)HashGetValue(entry);

View File

@ -350,7 +350,7 @@ typedef enum {
if (cmd->tx_argc > 2)
{
resisdata->minres = MagAtof(cmd->tx_argv[2]);
if (resisdata->minres <= 0)
if (resisdata->minres < 0)
{
TxError("Usage: %s minres [value]\n", cmd->tx_argv[0]);
return;