mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
Fix for an error message seen when testing the shx shared-library
program: do not allow a negative timestep.
This commit is contained in:
committed by
Holger Vogt
parent
a649514e87
commit
0029d415ee
+8
-2
@@ -2471,8 +2471,14 @@ sharedsync(double *pckttime, double *pcktdelta, double olddelta, double finalt,
|
||||
step if return value from getsync is 1. */
|
||||
int retval = getsync(*pckttime, pcktdelta, olddelta, redostep, ng_ident, loc, userptr);
|
||||
/* never move beyond final time */
|
||||
if (*pckttime + *pcktdelta > finalt)
|
||||
*pcktdelta = finalt - *pckttime - 1.1 * delmin;
|
||||
if (*pckttime + *pcktdelta > finalt) {
|
||||
double newdelta;
|
||||
|
||||
newdelta = finalt - *pckttime - 1.1 * delmin;
|
||||
if (newdelta <= 0.0)
|
||||
newdelta = finalt - *pckttime;
|
||||
*pcktdelta = newdelta;
|
||||
}
|
||||
|
||||
/* user has decided to redo the step, ignoring redostep being set to 0
|
||||
by ngspice. */
|
||||
|
||||
Reference in New Issue
Block a user