[FIX] Fix subscription hash's warns

This commit is contained in:
LDA 2024-09-20 07:01:35 +02:00
commit 9b4d97b033

View file

@ -10,7 +10,7 @@
#include <string.h> #include <string.h>
static char * static char *
SubscriptionHash(ParseeData *data, char *from, char *to) SubscriptionHash(char *from, char *to)
{ {
uint8_t *sum; uint8_t *sum;
char *hash; char *hash;
@ -22,7 +22,7 @@ SubscriptionHash(ParseeData *data, char *from, char *to)
memcpy(&sum[0], from, strlen(from)); memcpy(&sum[0], from, strlen(from));
memcpy(&sum[strlen(from) + 1], to, strlen(to)); memcpy(&sum[strlen(from) + 1], to, strlen(to));
hash = Base64Encode(sum, len); hash = Base64Encode((const char *) sum, len);
Free(sum); Free(sum);
return hash; return hash;
@ -54,7 +54,7 @@ AddPresenceSubscriber(ParseeData *data, char *from, char *to)
} }
database = data->db; database = data->db;
hash = SubscriptionHash(data, from, to); hash = SubscriptionHash(from, to);
ref = DbCreate(database, 2, "subs", hash); ref = DbCreate(database, 2, "subs", hash);
if (!ref) if (!ref)
{ {
@ -82,7 +82,7 @@ IsSubscribed(ParseeData *data, char *user, char *to)
} }
database = data->db; database = data->db;
hash = SubscriptionHash(data, user, to); hash = SubscriptionHash(user, to);
ret = DbExists(database, 2, "subs", hash); ret = DbExists(database, 2, "subs", hash);
Free(hash); Free(hash);