mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
(mc_search__hex_translate_to_regex): remove explicit handling of 0x prefixes.
scanf("%x") knows to eat up this prefix[1][2], so we don't need to do this ourselves. [1] K&R's "The C Programming Language" documents "%x" as "hexadecimal integer (with or without leading 0x or 0X)" [2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
f96b11cf66
commit
eff4d74743
@ -78,11 +78,6 @@ mc_search__hex_translate_to_regex (const GString * astr, mc_search_hex_parse_err
|
||||
while (g_ascii_isspace (str[loop]))
|
||||
loop++;
|
||||
}
|
||||
else if (str[loop] == '0' && (str[loop + 1] == 'x' || str[loop + 1] == 'X'))
|
||||
{
|
||||
/* Skip 0x prefixes. */
|
||||
loop += 2;
|
||||
}
|
||||
/* cppcheck-suppress invalidscanf */
|
||||
else if (sscanf (str + loop, "%x%n", &val, &ptr) == 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user