From 3b272cc8d275d5e0c833229f4f1155db54301914 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Tue, 23 Jun 2026 19:41:53 -0400 Subject: [PATCH] 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. --- resis/ResReadExt.c | 6 ++++-- resis/ResRex.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resis/ResReadExt.c b/resis/ResReadExt.c index 9ee11ef2..5e96db81 100644 --- a/resis/ResReadExt.c +++ b/resis/ResReadExt.c @@ -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); diff --git a/resis/ResRex.c b/resis/ResRex.c index 6d7756c4..bd1a1cc8 100644 --- a/resis/ResRex.c +++ b/resis/ResRex.c @@ -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;