Files
xrdp/common
matt335672 bc0e169451 Rationalise g_htoi() / xrdp_wm_htoi()
xrdp contains two functions which do similar things:-
- g_htoi() converts a hex string to an integer, ignoring unrecognised
  characters
- xrdp_wm_htoi() converts a hex string to an integer, ignoring leading
  whitespace, but terminating on unrecognised characters

An analysis of the uses of g_htoi() shows that the only place where
unrecognised characters might be encountered is parsing lines from
xrdp_keyboard.ini, where all values have an '0x' prefix (i.e. the 'x'
is unrecognised)

An analysis of xrdp_wm_htoi() shows that the functionality to ignore
leading whitespace is not used.

Both functions are replaced with a re-written g_htoi() which is const-
correct and provided with test cases. This function behaves in
the same way as the atoi() library function, in that it terminates on
an unexpected character.

The use of g_htoi() in parsing lines from xrdp_keyboard.ini is replaced
with a call to g_atoix() which handles the '0x' prefix correctly.
2025-03-31 15:36:51 +01:00
..
2022-09-03 02:01:48 +00:00
2022-01-28 12:23:40 +00:00
2023-05-22 14:43:22 +01:00
2023-05-22 14:43:22 +01:00
2025-02-27 15:04:11 +00:00
2025-02-27 15:04:11 +00:00
2023-04-24 14:20:14 +01:00
2024-11-08 15:57:40 +00:00
2024-11-08 15:57:40 +00:00
2023-03-14 02:02:09 -04:00
2023-10-26 15:17:17 +01:00
2020-01-06 15:46:37 +00:00
2022-09-03 02:01:48 +00:00
2020-01-06 15:46:37 +00:00
2020-01-06 15:46:37 +00:00
2023-10-18 10:07:49 +01:00
2024-02-08 15:52:54 +09:00
2024-08-05 10:44:10 +01:00
2025-02-14 11:57:42 +00:00
2025-03-12 10:01:27 +00:00
2023-10-18 10:07:49 +01:00
2014-07-25 22:24:40 -07:00
2024-08-05 10:44:10 +01:00