Added protected memory allocation to stacktrace
[runtime.git] / lib / silcutil / tests / test_silctree.c
index 9f614c185796dca7db63bc95a607308a45c32ae7..ea2be1ab12453f936ae97c18f361b6082d2ef87d 100644 (file)
@@ -18,7 +18,11 @@ static int compare(void *e1, void *e2, void *context)
 {
   Foo *f1 = e1, *f2 = e2;
   SILC_LOG_DEBUG(("%p %d > %p %d", f1, f1->id, f2, f2->id));
-  return f1->id - f2->id;
+  if (f1->id > f2->id)
+    return SILC_COMPARE_GREATER_THAN;
+  if (f1->id < f2->id)
+    return SILC_COMPARE_LESS_THAN;
+  return SILC_COMPARE_EQUAL_TO;
 }
 
 int main(int argc, char **argv)