X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvars-atr.c;h=5f42fc8f4051e7865f8f3d668edf80c77df15ddf;hb=20fd432b34d65999f06fabfa8e9c3f5efbac41bd;hp=3ce08b05ce753c69eb841c53482d5dc90f8dde68;hpb=46cc6dd316280579f5b03dfd39d01bc7daf88df7;p=pspp-builds.git diff --git a/src/vars-atr.c b/src/vars-atr.c index 3ce08b05..5f42fc8f 100644 --- a/src/vars-atr.c +++ b/src/vars-atr.c @@ -81,7 +81,7 @@ compare_values (const union value *a, const union value *b, int width) if (width == 0) return a->f < b->f ? -1 : a->f > b->f; else - return memcmp (a->s, b->s, width); + return memcmp (a->s, b->s, min(MAX_SHORT_STRING, width)); } /* Create a hash of v */ @@ -93,7 +93,7 @@ hash_value(const union value *v, int width) if ( 0 == width ) id_hash = hsh_hash_double (v->f); else - id_hash = hsh_hash_bytes (v->s, width); + id_hash = hsh_hash_bytes (v->s, min(MAX_SHORT_STRING, width)); return id_hash; }