Changed all the licence notices in all the files.
[pspp-builds.git] / src / dictionary.c
index c335423755444bbd5b762dd489c59bbd43d56e9f..a3185b997129c324808d2411419fe56e8ebb1c8f 100644 (file)
@@ -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 <config.h>
 #include "dictionary.h"
@@ -422,7 +422,7 @@ dict_create_var_x (struct dictionary *d, const char *name, int width,
   else
     {
       const char *sn = make_short_name(d, name);
-      strncpy(v->name, sn, SHORT_NAME_LEN);
+      strncpy(v->name, sn, SHORT_NAME_LEN + 1);
       free(sn);
     }
   
@@ -566,6 +566,7 @@ dict_rename_var (struct dictionary *d, struct variable *v,
   strncpy (v->name, new_name, sizeof v->name);
   v->name[SHORT_NAME_LEN] = '\0';
   hsh_force_insert (d->name_tab, v);
+  dict_add_longvar_entry (d, new_name, new_name);
 }
 
 /* Returns the variable named NAME in D, or a null pointer if no
@@ -774,7 +775,7 @@ dict_rename_vars (struct dictionary *d,
       assert (strlen (new_names[i]) <= LONG_NAME_LEN );
       
       sn = make_short_name(d, new_names[i]);
-      strncpy(vars[i]->name, sn, SHORT_NAME_LEN);
+      strncpy(vars[i]->name, sn, SHORT_NAME_LEN + 1);
       free(sn);
       
 
@@ -1272,6 +1273,7 @@ make_short_name(struct dictionary *dict, const char *longname)
        strcat(d, suffix);
   }
 
+
   return d;
 }