Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix MC gcc builds :(
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 12 Feb 2022 13:05:50 +0000 (14:05 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 12 Feb 2022 13:05:50 +0000 (14:05 +0100)
src/mc/remote/AppSide.cpp

index 3517fe1..496c5bc 100644 (file)
@@ -106,9 +106,9 @@ void AppSide::handle_simcall_execute(const s_mc_message_simcall_execute_t* messa
   if (actor->simcall_.observer_ != nullptr) {
     std::stringstream stream;
     actor->simcall_.observer_->serialize(answer.simcall, stream);
-    xbt_assert(stream.str().size() < sizeof(answer.buffer),
+    xbt_assert(stream.str().size() < sizeof(answer.buffer) - 1,
                "The serialized simcall is too large for the buffer. Please fix the code.");
-    strncpy(answer.buffer, stream.str().c_str(), SIMCALL_SERIALIZATION_BUFFER_SIZE);
+    strncpy(answer.buffer, stream.str().c_str(), sizeof(answer.buffer) - 1);
   } else {
     answer.simcall = mc::Transition::Type::UNKNOWN;
   }