X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fpc%2B-file-reader.c;h=979be50c47aacef160540c46179d00e1fc10efa8;hb=259b5c32c06fd93964720f4a0e7844b5a24c55db;hp=4d08f27465407bff935163af10525bea0237e653;hpb=d6cbbc8d634fa91f050661355139a4e4697e99ab;p=pspp diff --git a/src/data/pc+-file-reader.c b/src/data/pc+-file-reader.c index 4d08f27465..979be50c47 100644 --- a/src/data/pc+-file-reader.c +++ b/src/data/pc+-file-reader.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-2000, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1997-2000, 2006-2007, 2009-2016 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -221,13 +221,13 @@ pcp_open (struct file_handle *fh) /* Fetch file size. */ if (fstat (fileno (r->file), &s)) { - pcp_error (ME, 0, _("%s: stat failed (%s)."), + pcp_error (r, 0, _("%s: stat failed (%s)."), fh_get_file_name (r->fh), strerror (errno)); goto error; } if (s.st_size > UINT_MAX) { - pcp_error (ME, 0, _("%s: file too large."), fh_get_file_name (r->fh)); + pcp_error (r, 0, _("%s: file too large."), fh_get_file_name (r->fh)); goto error; } r->file_size = s.st_size; @@ -461,7 +461,7 @@ pcp_decode (struct any_reader *r_, const char *encoding, error: pcp_close (&r->any_reader); - dict_destroy (dict); + dict_unref (dict); *dictp = NULL; return NULL; } @@ -641,8 +641,9 @@ read_value_labels (struct pcp_reader *r, struct pcp_var_record *var, uint8_t len; if (var->n_val_labs >= allocated_val_labs) - var->val_labs = x2nrealloc (var->val_labs, &allocated_val_labs, - sizeof *var->val_labs); + var->val_labs = pool_2nrealloc (r->pool, var->val_labs, + &allocated_val_labs, + sizeof *var->val_labs); vl = &var->val_labs[var->n_val_labs]; if (!read_bytes (r, vl->value, sizeof vl->value)