Skip to content

Commit

Permalink
Bug fix: M261.x always required a V parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dc42 committed Sep 22, 2024
1 parent c264985 commit f556068
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Platform/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2574,14 +2574,14 @@ GCodeResult Platform::ReceiveI2cOrModbus(GCodeBuffer& gb, const StringRef &reply
String<MaxVariableNameLength> varName;
bool seenV = false;
gb.TryGetQuotedString('V', varName.GetRef(), seenV, false);
if (!Variable::IsValidVariableName(varName.c_str()))
{
reply.printf("variable '%s' is not a valid name", varName.c_str());
return GCodeResult::error;
}
Variable *_ecv_null resultVar = nullptr;
if (seenV)
{
if (!Variable::IsValidVariableName(varName.c_str()))
{
reply.printf("variable '%s' is not a valid name", varName.c_str());
return GCodeResult::error;
}
auto vset = WriteLockedPointer<VariableSet>(nullptr, &gb.GetVariables());
Variable *_ecv_null const v = vset->Lookup(varName.c_str(), false);
if (v != nullptr)
Expand Down

0 comments on commit f556068

Please # to comment.