Fix possible incorrect assertion when creating unique casereaders.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 Sep 2021 16:59:52 +0000 (18:59 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 Sep 2021 18:06:35 +0000 (20:06 +0200)
* src/data/casereader-translator.c (uniquify): Force dir to be an element of  {0, 1, -1}

src/data/casereader-translator.c

index a6508502b7348115b9ded5b8ee7fc66c7c116f95..3567f5c3a569b82bb1b5bff06e4b2a9146121957 100644 (file)
@@ -502,6 +502,11 @@ uniquify (const struct ccase *c, void *aux)
 
   dir = value_compare_3way (case_data (next_case, cdr->key),
                            current_value, key_width);
+  if (dir > 0)
+    dir = 1;
+  if (dir < 0)
+    dir = -1;
+      
   case_unref (next_case);
   if (dir != 0)
     {