X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcompute.c;h=6e6bd96ad18992c1b361b2d191825d6c0459ff7a;hb=1f8dd363d6c20d07fcca14cb948018465fa5ed8b;hp=e6afe0b62d7e76383f54f524cfbec587a5058a66;hpb=d807ad29cc0d3caa4f0e04ee4b75c70a225cfeaf;p=pspp-builds.git diff --git a/src/compute.c b/src/compute.c index e6afe0b6..6e6bd96a 100644 --- a/src/compute.c +++ b/src/compute.c @@ -14,8 +14,8 @@ 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 #include "error.h" @@ -31,6 +31,9 @@ #include "str.h" #include "var.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + struct compute_trns; struct lvalue; @@ -310,12 +313,12 @@ compute_trns_free (struct trns_header *compute_) /* COMPUTE or IF target variable or vector element. */ struct lvalue { - char var_name[9]; /* Destination variable name, or "". */ + char var_name[LONG_NAME_LEN + 1]; /* Destination variable name, or "". */ const struct vector *vector; /* Destination vector, if any, or NULL. */ struct expression *element; /* Destination vector element, or NULL. */ }; -/* Parses the target variable or vector elector into a new +/* Parses the target variable or vector element into a new `struct lvalue', which is returned. */ static struct lvalue * lvalue_parse (void) @@ -353,8 +356,7 @@ lvalue_parse (void) else { /* Variable name. */ - strncpy (lvalue->var_name, tokid, 8); - lvalue->var_name[8] = '\0'; + str_copy_trunc (lvalue->var_name, sizeof lvalue->var_name, tokid); lex_get (); } return lvalue; @@ -371,8 +373,7 @@ lvalue_get_type (const struct lvalue *lvalue) { if (lvalue->vector == NULL) { - struct variable *var - = dict_lookup_var (default_dict, lvalue->var_name); + struct variable *var = dict_lookup_var (default_dict, lvalue->var_name); if (var == NULL) return NUMERIC; else