From: John Darrington <john@darrington.wattle.id.au>
Date: Sat, 23 Apr 2005 09:27:24 +0000 (+0000)
Subject: Much as valgrind is very usefull, it can sometimes hide problems.
X-Git-Tag: v0.4.0~113
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=432fb6929d9d0585a0dcdd9e6251b17f4c14c984;p=pspp-builds.git

Much as valgrind is very usefull, it can sometimes hide problems.
This change corrects one such problem.
---

diff --git a/po/en_GB.po b/po/en_GB.po
index b4205f91..64118272 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PSPP 0.3.1\n"
 "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2005-04-21 11:41+0800\n"
+"POT-Creation-Date: 2005-04-23 15:57+0800\n"
 "PO-Revision-Date: 2004-01-23 13:04+0800\n"
 "Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
 "Language-Team: John Darrington <john@darrington.wattle.id.au>\n"
@@ -1136,13 +1136,13 @@ msgstr ""
 msgid "Error writing file %s: %s."
 msgstr ""
 
-#: src/dictionary.c:256
+#: src/dictionary.c:258
 #, c-format
 msgid ""
 "The entry \"%s\" in the variable name map, has no corresponding variable"
 msgstr ""
 
-#: src/dictionary.c:836
+#: src/dictionary.c:856
 msgid ""
 "At least one case in the data file had a weight value that was user-missing, "
 "system-missing, zero, or negative.  These case(s) were ignored."
@@ -3046,7 +3046,7 @@ msgstr ""
 msgid "corrupt system file: "
 msgstr ""
 
-#: src/sfm-read.c:149 src/sfm-write.c:918
+#: src/sfm-read.c:149 src/sfm-write.c:919
 #, c-format
 msgid "%s: Closing system file: %s."
 msgstr ""
@@ -3372,7 +3372,7 @@ msgstr ""
 msgid "Error opening \"%s\" for writing as a system file: %s."
 msgstr ""
 
-#: src/sfm-write.c:738
+#: src/sfm-write.c:739
 #, c-format
 msgid "%s: Writing system file: %s."
 msgstr ""
diff --git a/po/pspp.pot b/po/pspp.pot
index 47d888d5..f6e648bd 100644
--- a/po/pspp.pot
+++ b/po/pspp.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2005-04-21 11:41+0800\n"
+"POT-Creation-Date: 2005-04-23 15:57+0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1137,13 +1137,13 @@ msgstr ""
 msgid "Error writing file %s: %s."
 msgstr ""
 
-#: src/dictionary.c:256
+#: src/dictionary.c:258
 #, c-format
 msgid ""
 "The entry \"%s\" in the variable name map, has no corresponding variable"
 msgstr ""
 
-#: src/dictionary.c:836
+#: src/dictionary.c:856
 msgid ""
 "At least one case in the data file had a weight value that was user-missing, "
 "system-missing, zero, or negative.  These case(s) were ignored."
@@ -3047,7 +3047,7 @@ msgstr ""
 msgid "corrupt system file: "
 msgstr ""
 
-#: src/sfm-read.c:149 src/sfm-write.c:918
+#: src/sfm-read.c:149 src/sfm-write.c:919
 #, c-format
 msgid "%s: Closing system file: %s."
 msgstr ""
@@ -3373,7 +3373,7 @@ msgstr ""
 msgid "Error opening \"%s\" for writing as a system file: %s."
 msgstr ""
 
-#: src/sfm-write.c:738
+#: src/sfm-write.c:739
 #, c-format
 msgid "%s: Writing system file: %s."
 msgstr ""
diff --git a/src/ChangeLog b/src/ChangeLog
index 2ea75ebb..248c344e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+	* dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
+
 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
 
 	Start work on fixing MATCH FILES.
diff --git a/src/dictionary.c b/src/dictionary.c
index c3354237..141dd8e1 100644
--- a/src/dictionary.c
+++ b/src/dictionary.c
@@ -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);
     }
   
@@ -774,7 +774,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 +1272,7 @@ make_short_name(struct dictionary *dict, const char *longname)
 	strcat(d, suffix);
   }
 
+
   return d;
 }