From 32a5be52e111556f8ba0172daf83ee4020a0b84d Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Wed, 19 Jun 2024 18:50:24 -0500 Subject: [PATCH] Add note about non-ASCII decimal_sep length --- src/wutil/wcstod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wutil/wcstod.rs b/src/wutil/wcstod.rs index 20d8efe90..32b15cb08 100644 --- a/src/wutil/wcstod.rs +++ b/src/wutil/wcstod.rs @@ -56,7 +56,9 @@ fn parse_dec_float(chars: I, decimal_sep: char, consumed: &mut usize) -> Opti } } let res = s.parse::().ok()?; - *consumed = s.len(); // note this is the number of chars because only ASCII is recognized. + // Note: this is the number of chars because only ASCII is recognized. + // XXX: This assumption only holds if decimal_sep is also ASCII! + *consumed = s.len(); Some(res) }