X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompute.c;h=256b6a7e3eec3be34d1590c6b88974b661c1b1e4;hb=c1e0ac4b743ba15ffbe32e1d95cc7b4b40b1eaa4;hp=2152b6db1a71e5addcd30cad2a56b2c1860656f4;hpb=05e356b2a3087e819ef3b5388e29c822f41502e1;p=pspp diff --git a/src/compute.c b/src/compute.c index 2152b6db1a..256b6a7e3e 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" @@ -315,7 +315,7 @@ struct lvalue 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 +353,7 @@ lvalue_parse (void) else { /* Variable name. */ - strncpy (lvalue->var_name, tokid, LONG_NAME_LEN); - lvalue->var_name[LONG_NAME_LEN] = '\0'; + str_copy_trunc (lvalue->var_name, sizeof lvalue->var_name, tokid); lex_get (); } return lvalue; @@ -371,8 +370,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