mirror of
https://github.com/nlohmann/json.git
synced 2026-09-01 14:07:14 +00:00
Make the "buffers are large enough" reasoning explicit: before the copy, assert that `copied` fits both the caller-provided destination (`wanted` bytes) and the remaining input range (`available` bytes). These hold by construction (`copied = min(wanted, available)`) but were previously only implied; the asserts document the invariant and would catch a future regression that breaks it. Signed-off-by: Niels Lohmann <mail@nlohmann.me> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>