fixed mingw warnings by making clean hex to binary conversion on hash parsing

pull/2041/head
Sein Coray 5 years ago
parent 90ad225a8c
commit 3ac09d31a3
No known key found for this signature in database
GPG Key ID: 44C4180EA69758EC

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

Loading…
Cancel
Save