This commit is contained in:
rlar 2011-04-28 19:27:45 +00:00
parent b778c50bd6
commit 46da3b066e
2 changed files with 26 additions and 10 deletions

View File

@ -1,4 +1,20 @@
2011-04-27 Robert Larice 2011-04-28 Robert Larice
* src/frontend/inpcom.c ,
bug fix, (#329233)
http://sourceforge.net/tracker/?func=detail&atid=423915&aid=3292330&group_id=38962
this fix is for
E1 OUT 0 vol='V(IN)>1 && V(IN)>0 ? 1 : 0'
FIXME,
INPevaluate() should skip a trailing `unit' string
FIXME,
E1 OUT 0 vol='(V(IN)>1) and (V(IN)>0) ? 1 : 0'
this is simply incorrect syntax, but shoudn't segfault.
inp_chk_for_multi_in_vcvs()
is much to simple minded.
2011-04-28 Robert Larice
* src/main.c , * src/main.c ,
* src/frontend/com_measure2.c , * src/frontend/com_measure2.c ,
* src/frontend/inpcom.c , * src/frontend/inpcom.c ,
@ -10,7 +26,7 @@
* src/spicelib/devices/vsrc/vsrcacct.c : * src/spicelib/devices/vsrc/vsrcacct.c :
code cleanup, some warnings, some casts, ... code cleanup, some warnings, some casts, ...
2011-04-27 Robert Larice 2011-04-28 Robert Larice
* */** : * */** :
code cleanup, drop NULL pointer casts code cleanup, drop NULL pointer casts

View File

@ -4334,8 +4334,6 @@ static void inp_bsource_compat(struct line *deck)
char buf[512]; char buf[512];
size_t i, xlen, ustate = 0; size_t i, xlen, ustate = 0;
int skip_control = 0; int skip_control = 0;
char *cvalue;
double dvalue;
int error1; int error1;
for (card = deck; card; card = card->li_next) { for (card = deck; card; card = card->li_next) {
@ -4538,15 +4536,17 @@ static void inp_bsource_compat(struct line *deck)
else if (isdigit(actchar)) else if (isdigit(actchar))
{ {
/* allow 100p, 5MEG etc. */ /* allow 100p, 5MEG etc. */
dvalue = INPevaluate(&str_ptr, &error1, 2); double dvalue = INPevaluate(&str_ptr, &error1, 0);
cvalue = TMALLOC(char, 19); char cvalue[19];
sprintf(cvalue,"%18.10e", dvalue);
/* unary -, change sign */ /* unary -, change sign */
if (ustate == 2) { if (ustate == 2)
cvalue[0] = '-'; dvalue *= -1;
} sprintf(cvalue,"%18.10e", dvalue);
cwl->wl_word = copy(cvalue); cwl->wl_word = copy(cvalue);
ustate = 0; /* we have a number */ ustate = 0; /* we have a number */
/* skip the `unit', FIXME INPevaluate() should do this */
while(isalpha(*str_ptr))
str_ptr++;
} }
else /* strange char */ else /* strange char */
{ {