Fix invalid brain session id calculation and move sorting functions to shared.c

This commit is contained in:
Jens Steube
2020-05-11 11:52:36 +02:00
parent 08ea00020a
commit d5cd0a0030
7 changed files with 20 additions and 20 deletions
+16
View File
@@ -97,6 +97,22 @@ static const char *HASH_CATEGORY_OTP_STR = "One-Time Password
static const char *HASH_CATEGORY_PLAIN_STR = "Plaintext";
static const char *HASH_CATEGORY_FRAMEWORK_STR = "Framework";
int sort_by_string (const void *p1, const void *p2)
{
const char *s1 = (const char *) p1;
const char *s2 = (const char *) p2;
return strcmp (s1, s2);
}
int sort_by_stringptr (const void *p1, const void *p2)
{
const char* const *s1 = (const char* const *) p1;
const char* const *s2 = (const char* const *) p2;
return strcmp (*s1, *s2);
}
static inline int get_msb32 (const u32 v)
{
int i;