• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ConnectionMaster / json / 36476276517
98%

Build:
DEFAULT BRANCH: develop
Ran 28 Sep 2026 09:48PM UTC
Jobs 1
Files 34
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Sep 2026 03:56PM UTC coverage: 98.079% (-0.07%) from 98.147%
36476276517

push

github

web-flow
Look up the locale decimal point at conversion time, not lexer construction (#5597)

* Look up the locale decimal point at conversion time, not lexer construction

The lexer read localeconv()->decimal_point once in its constructor and wrote
that character into token_buffer in place of '.'. The strtod fallback then
used the locale current at conversion time, so an LC_NUMERIC change in
between (parser callback, SAX handler, another thread) truncated the value
in release builds and fired the endptr assertion in debug builds.

token_buffer now always holds '.'. Only the strtof/strtod/strtold fallback
depends on the locale: it looks up the decimal point right before the call,
restores '.' afterwards, and repeats the conversion if the locale changed in
between. As a side effect, std::from_chars and Clinger's fast path now also
apply under locales whose decimal point is not '.'.

Fixes #5198

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Stop the strtod retry loop when the decimal point is unchanged

convert_float_locale_aware() repeated the conversion until strtod
consumed the whole token, assuming an early stop can only mean a locale
change. Under a locale whose decimal point is not a single character
(e.g. the two-byte U+066B of ar_EG.UTF-8, ar_SA.UTF-8, or fa_IR.UTF-8,
all available on macOS), the in-place substitution can never succeed,
so parsing any float that reaches the strtod fallback (for example
3.14159265358979323846 at C++11) hung forever. Before this branch, the
same input was truncated.

Retry only if the decimal point changed since the previous attempt;
otherwise keep the value strtod parsed so far, as before. Add a test
that parses such numbers under a multi-byte decimal point locale; it
hangs without this change.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Fix -Weffc++ errors in the #5198 locale test

GCC's -Weffc++ (an error in ci_test_gcc and ci_test_standards_gcc)
rejected LocaleSwitchingSax: it has a pointer data member bu... (continued)

3074 of 3195 branches covered (96.21%)

Branch coverage included in aggregate %.

21 of 26 new or added lines in 2 files covered. (80.77%)

27 existing lines in 2 files now uncovered.

8411 of 8515 relevant lines covered (98.78%)

13027704.63 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
97.41
-0.73% include/nlohmann/detail/input/lexer.hpp

Coverage Regressions

Lines Coverage ∆ File
26
96.29
-0.0% include/nlohmann/detail/input/binary_reader.hpp
1
98.06
0.0% include/nlohmann/detail/input/number_parse.hpp
Jobs
ID Job ID Ran Files Coverage
1 36476276517.1 28 Sep 2026 09:48PM UTC 34
98.08
GitHub Action Run
Source Files on build 36476276517
  • Tree
  • List 34
  • Changed 5
  • Source Changed 3
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36476276517
  • fc03b991 on github
  • Prev Build on develop (#36346474524)
  • Next Build on develop (#36540151856)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc