X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvalue-labels.c;h=f54a4870fc05bf3b02ac9a2e6405cde5dbfefe62;hb=8b5eeea8fa0ed31ab3f174647ef111db39c1e177;hp=81bb375eeca5538fa27c71e5b33735c5368fc762;hpb=338fb2a2e84df6427a2fdee6769421f57d5666d8;p=pspp-builds.git diff --git a/src/data/value-labels.c b/src/data/value-labels.c index 81bb375e..f54a4870 100644 --- a/src/data/value-labels.c +++ b/src/data/value-labels.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . 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. */