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:
parent
06f0ce4259
commit
3b272cc8d2
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue