cleanup: Move loop var from int to size_t in omemo.c

This commit is contained in:
Michael Vetter
2026-02-20 13:15:56 +01:00
parent 7eb64b2779
commit 10a68437ad

View File

@@ -1030,7 +1030,7 @@ omemo_format_fingerprint(const char* const fingerprint)
{ {
char* output = malloc(strlen(fingerprint) + strlen(fingerprint) / 8); char* output = malloc(strlen(fingerprint) + strlen(fingerprint) / 8);
int i, j; size_t i, j;
for (i = 0, j = 0; i < strlen(fingerprint); i++) { for (i = 0, j = 0; i < strlen(fingerprint); i++) {
if (i > 0 && i % 8 == 0) { if (i > 0 && i % 8 == 0) {
output[j++] = '-'; output[j++] = '-';
@@ -1117,7 +1117,7 @@ omemo_is_trusted_identity(const char* const jid, const char* const fingerprint)
static char* static char*
_omemo_fingerprint(ec_public_key* identity, gboolean formatted) _omemo_fingerprint(ec_public_key* identity, gboolean formatted)
{ {
int i; size_t i;
signal_buffer* identity_public_key; signal_buffer* identity_public_key;
ec_public_key_serialize(&identity_public_key, identity); ec_public_key_serialize(&identity_public_key, identity);
@@ -1161,8 +1161,8 @@ _omemo_fingerprint_decode(const char* const fingerprint, size_t* len)
{ {
unsigned char* output = malloc(strlen(fingerprint) / 2 + 1); unsigned char* output = malloc(strlen(fingerprint) / 2 + 1);
int i; size_t i;
int j; size_t j;
for (i = 0, j = 0; i < strlen(fingerprint);) { for (i = 0, j = 0; i < strlen(fingerprint);) {
if (!g_ascii_isxdigit(fingerprint[i])) { if (!g_ascii_isxdigit(fingerprint[i])) {
i++; i++;
@@ -1724,7 +1724,7 @@ _bytes_from_hex(const char* hex, size_t hex_size,
memset(bytes, 0, bytes_size); memset(bytes, 0, bytes_size);
for (int i = 0; (i < hex_size) && (i / 2 < bytes_size); i += 2) { for (size_t i = 0; (i < hex_size) && (i / 2 < bytes_size); i += 2) {
b0 = ((unsigned char)hex[i + 0] & 0x1f) ^ 0x10; b0 = ((unsigned char)hex[i + 0] & 0x1f) ^ 0x10;
b1 = ((unsigned char)hex[i + 1] & 0x1f) ^ 0x10; b1 = ((unsigned char)hex[i + 1] & 0x1f) ^ 0x10;