X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsubclist.c;h=95ea455d6164b09856c299ff54ae29dbcdcb3ea6;hb=d7b5d9144738a5a8989d45a01f4e458a78b68c0b;hp=2a7f3679d955f7390557360fa3cab56f59fec5cd;hpb=4239c455e7b1061b7c960b793f9080e113123845;p=pspp diff --git a/src/subclist.c b/src/subclist.c index 2a7f3679d9..95ea455d61 100644 --- a/src/subclist.c +++ b/src/subclist.c @@ -17,12 +17,13 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ #include "subclist.h" #include +#include "xalloc.h" /* I call these objects `lists' but they are in fact simple dynamic arrays */ @@ -32,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA void subc_list_double_create(subc_list_double *l) { - l->data = (double *) malloc(CHUNKSIZE * sizeof (double)); + l->data = xnmalloc (CHUNKSIZE, sizeof *l->data); l->sz = CHUNKSIZE; l->n_data = 0; } @@ -46,7 +47,7 @@ subc_list_double_push(subc_list_double *l, double d) if (l->n_data >= l->sz ) { l->sz += CHUNKSIZE; - l->data = realloc(l->data, l->sz * sizeof(double)); + l->data = xnrealloc (l->data, l->sz, sizeof *l->data); } }