mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
AK: Pass correct length to StringUtils::convert_to_floating_point()
Fixed the issue in StringUtils::convert_to_floating_point() where the end pointer of the trimmed string was not being passed, causing the function to consistently return 'None' when given strings with trailing whitespaces.
This commit is contained in:
@@ -247,7 +247,7 @@ Optional<T> convert_to_floating_point(StringView str, TrimWhitespace trim_whites
|
||||
: str;
|
||||
|
||||
char const* start = string.characters_without_null_termination();
|
||||
return parse_floating_point_completely<T>(start, start + str.length());
|
||||
return parse_floating_point_completely<T>(start, start + string.length());
|
||||
}
|
||||
|
||||
template Optional<double> convert_to_floating_point(StringView str, TrimWhitespace);
|
||||
|
||||
Reference in New Issue
Block a user