fixed sparse-array linker problem
[pspp-builds.git] / src / data / value-labels.c
index 81bb375eeca5538fa27c71e5b33735c5368fc762..f54a4870fc05bf3b02ac9a2e6405cde5dbfefe62 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -91,7 +90,8 @@ val_labs_copy (const struct val_labs *vls)
 bool
 val_labs_can_set_width (const struct val_labs *vls, int new_width) 
 {
-  assert ((vls->width == 0) == (new_width == 0));
+  if ( var_type_from_width (new_width) != var_type_from_width (vls->width ))
+    return false;
 
   if (vls->width == 0)
     return new_width == 0;
@@ -403,7 +403,7 @@ hash_int_val_lab (const void *vl_, const void *vls_)
   if (vls->width == 0)
     return hsh_hash_double (vl->value.f);
   else
-    return hsh_hash_bytes (vl->value.s, sizeof vl->value.s);
+    return hsh_hash_bytes (vl->value.s, vls->width);
 }
 
 /* Free a value label. */