fix inline comments in dictionary files. The extrac checks broke the earlier logic, we now look for a hash sign in the current line if found we try to add a null terminator before the hash sign until we find a hexdigit. Apply old logic on the new shorter line.

This commit is contained in:
iceman1001 2025-01-27 23:24:45 +01:00
parent 4803f51f3f
commit 6624a978d1

@ -2398,8 +2398,18 @@ int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, vo
continue;
}
char *pos = strstr(line, "#");
if (pos) {
// we found a inline comment, add a null terminator, until we hit hexadecimal char
while (isxdigit(pos[0]) == 0) {
pos[0] = 0x00;
--pos;
}
}
// larger keys than expected is skipped
if (strlen(line) > keylen) {
PrintAndLogEx(INFO, "larger %zu - %s", strlen(line), line);
continue;
}