[libc++][format] Fixes an off by one error.
authorMark de Wever <koraq@xs4all.nl>
Fri, 7 Jul 2023 16:32:20 +0000 (18:32 +0200)
committerMark de Wever <koraq@xs4all.nl>
Mon, 17 Jul 2023 16:01:19 +0000 (18:01 +0200)
commit7583c73bc4faf2b37f6c75ec64eddaa99f058b65
treec0b21399cfbb9e26b214535488e2bc970e9d0ffe
parent27245077643ae8b94a0511ee1c3a39d6f4ca8076
[libc++][format] Fixes an off by one error.

The post-condition on the functions is that the buffer is not full.
This post-conditon is used as pre-condition of the push_back function.
When a copy, fill, of transform function exactly fit in the buffer this
post-condition was validated.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D155397
libcxx/include/__format/buffer.h
libcxx/test/std/utilities/format/format.functions/format_tests.h