Skip to content

Commit

Permalink
Some tweaks to pass clap validation and remove a bad print
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Sep 18, 2024
1 parent 806035d commit 25c4283
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions clients/clap-first/scxt-plugin/scxt-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ bool SCXTPlugin::stateLoad(const clap_istream *istream) noexcept
}
}
buffer[totalRd] = 0;
if (totalRd == 0)
{
SCLOG("Received stream size 0. Invalid state");
return false;
}

auto xml = std::string(buffer.data());
auto data = std::string(buffer.data());

synchronousEngineUnstream(engine, xml);
synchronousEngineUnstream(engine, data);

scxt::messaging::client::clientSendToSerialization(
scxt::messaging::client::RequestHostCallback{(uint64_t)RESCAN_PARAM_IVT},
Expand Down Expand Up @@ -450,8 +455,6 @@ bool SCXTPlugin::handleEvent(const clap_event_header_t *nextEvent)
break;
default:
{
std::cout << __FILE__ << ":" << __LINE__ << " Unhandled event " << nextEvent->type
<< std::endl;
}
break;
}
Expand Down

0 comments on commit 25c4283

Please sign in to comment.