Skip to content

Commit

Permalink
Merge pull request #318 from DARMA-tasking/311-fix-sprintf-warning
Browse files Browse the repository at this point in the history
#311: Remove sprintf warning
  • Loading branch information
nlslatt authored Oct 24, 2023
2 parents ec734e0 + cf7f156 commit 833f42c
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 833f42c

Please sign in to comment.