diff options
Diffstat (limited to 'libs/libaxolotl/src/device_consistency.c')
-rw-r--r-- | libs/libaxolotl/src/device_consistency.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/libaxolotl/src/device_consistency.c b/libs/libaxolotl/src/device_consistency.c index 4b18bc1471..a079d11770 100644 --- a/libs/libaxolotl/src/device_consistency.c +++ b/libs/libaxolotl/src/device_consistency.c @@ -641,16 +641,18 @@ int device_consistency_signature_list_sort_comparator(const void *a, const void int result; const device_consistency_signature *sig1 = *((const device_consistency_signature **)a); const device_consistency_signature *sig2 = *((const device_consistency_signature **)b); - signal_buffer *buf1 = device_consistency_signature_get_signature(sig1); - signal_buffer *buf2 = device_consistency_signature_get_signature(sig2); + signal_buffer *buf1 = device_consistency_signature_get_vrf_output(sig1); + signal_buffer *buf2 = device_consistency_signature_get_vrf_output(sig2); size_t len1 = signal_buffer_len(buf1); size_t len2 = signal_buffer_len(buf2); if(len1 == len2) { result = memcmp(signal_buffer_data(buf1), signal_buffer_data(buf2), len1); } - else { - result = (int)(len1 - len2); + else if (len1 < len2) { + result = -1; + } else { + result = 1; } return result; |