Skip to content

Commit

Permalink
#311: Remove sprintf warning
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Oct 24, 2023
1 parent ec734e0 commit cf7f156
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/checkpoint/dispatch/reconstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ struct Reconstructor {

template <typename U = T>
static T* constructAllowFailImpl(void* buf, isNotConstructible<U>* = nullptr) {
std::unique_ptr<char[]> msg = std::make_unique<char[]>(32768);
sprintf(
constexpr int max_buffer_length = 32768;
std::unique_ptr<char[]> msg = std::make_unique<char[]>(max_buffer_length);
snprintf(
&msg[0],
max_buffer_length,
"Checkpoint is failing to reconstruct a class %s, due to it being "
"abstract or the absence of a suitable constructor (default or tagged) "
"or reconstruct()",
Expand Down

0 comments on commit cf7f156

Please sign in to comment.