Clean up and improve case code.
[pspp-builds.git] / src / language / stats / chisquare.c
index 05fe41e9719fbb33c69bd02925e967bc01b47990..a406edc7433d8ff9ef9f128d68385e32ef590f12 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - computes sample statistics.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 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
@@ -147,7 +147,7 @@ create_freq_hash (const struct dictionary *dict,
 
   struct hsh_table *freq_hash = 
     hsh_create (4, compare_freq, hash_freq, 
-               free_freq_hash,
+               free_freq_mutable_hash,
                (void *) var);
 
   while (casereader_read(r, &c))
@@ -172,7 +172,8 @@ create_freq_hash (const struct dictionary *dict,
        }
       else
        {
-         *existing_fr = fr;
+          *existing_fr = fr;
+          fr->value = value_dup (fr->value, var_get_width (var));
        }
 
       case_destroy (&c);