diff --git a/ChangeLog b/ChangeLog index 26efecbe1..da4541629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-10-24 Robert Larice + * src/misc/wlist.c , + * src/spicelib/devices/bsim3/b3set.c , + * src/spicelib/devices/bsim3soi/b4soiset.c , + * src/spicelib/devices/bsim4/b4set.c : + fix incorrect usage of tmalloc/sizeof, incorrect indirection level + 2010-10-24 Robert Larice * src/frontend/com_ahelp.c , * src/frontend/com_display.c , diff --git a/src/misc/wlist.c b/src/misc/wlist.c index aee1c84b1..d18bef713 100644 --- a/src/misc/wlist.c +++ b/src/misc/wlist.c @@ -144,7 +144,7 @@ wl_mkvec(wordlist *wl) char **v; len = wl_length(wl); - v = (char **) tmalloc((len + 1) * sizeof (char **)); + v = (char **) tmalloc((len + 1) * sizeof (char *)); for (i = 0; i < len; i++) { v[i] = copy(wl->wl_word); wl = wl->wl_next; diff --git a/src/spicelib/devices/bsim3/b3set.c b/src/spicelib/devices/bsim3/b3set.c index 24bea58b8..1541d5fc6 100644 --- a/src/spicelib/devices/bsim3/b3set.c +++ b/src/spicelib/devices/bsim3/b3set.c @@ -1033,7 +1033,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\ InstCount++; } } - InstArray = (BSIM3instance**)tmalloc(InstCount*sizeof(BSIM3instance**)); + InstArray = (BSIM3instance**)tmalloc(InstCount*sizeof(BSIM3instance*)); model = (BSIM3model*)inModel; idx = 0; for( ; model != NULL; model = model->BSIM3nextModel ) diff --git a/src/spicelib/devices/bsim3soi/b4soiset.c b/src/spicelib/devices/bsim3soi/b4soiset.c index 3d7a80130..1a66ffceb 100644 --- a/src/spicelib/devices/bsim3soi/b4soiset.c +++ b/src/spicelib/devices/bsim3soi/b4soiset.c @@ -2693,7 +2693,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\ InstCount++; } } - InstArray = (B4SOIinstance**)tmalloc(InstCount*sizeof(B4SOIinstance**)); + InstArray = (B4SOIinstance**)tmalloc(InstCount*sizeof(B4SOIinstance*)); model = (B4SOImodel*)inModel; idx = 0; for( ; model != NULL; model = model->B4SOInextModel ) diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index f66cbc6af..3d23bd69f 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -2408,7 +2408,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\ InstCount++; } } - InstArray = (BSIM4instance**)tmalloc(InstCount*sizeof(BSIM4instance**)); + InstArray = (BSIM4instance**)tmalloc(InstCount*sizeof(BSIM4instance*)); model = (BSIM4model*)inModel; idx = 0; for( ; model != NULL; model = model->BSIM4nextModel )