Skip to content
Snippets Groups Projects
Commit aa50abec authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

There is something horribly wrong with what sscanf(x, "%2hhx", &cptr)

does when compiled with mingw32.

Use "anything else" to convert hex to char.
parent 23d2b501
Branches
Tags
No related merge requests found
Pipeline #5865 passed
......@@ -779,11 +779,14 @@ read_item(str_list_t listfile, struct bbslist *entry, char *bbsname, int id, int
int i;
iniGetString(section, NULL, "SSHFingerprint", "", fp);
for (i = 0; i < 20; i++) {
if (sscanf(&fp[i * 2], "%2" SCNx8, &entry->ssh_fingerprint[i]) != 1)
if (!(isxdigit(fp[i*2]) && isxdigit(fp[i*2+1])))
break;
entry->ssh_fingerprint[i] = (HEX_CHAR_TO_INT(fp[i*2]) * 256) + HEX_CHAR_TO_INT(fp[i*2+1]);
}
if (i == 20)
entry->has_fingerprint = true;
else
entry->has_fingerprint = false;
}
else {
entry->has_fingerprint = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment