From 25c428346c2e2be8d88269374b224b361a3d3d3f Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 17 Sep 2024 23:44:36 -0400 Subject: [PATCH] Some tweaks to pass clap validation and remove a bad print --- clients/clap-first/scxt-plugin/scxt-plugin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clients/clap-first/scxt-plugin/scxt-plugin.cpp b/clients/clap-first/scxt-plugin/scxt-plugin.cpp index f2875cd0..c2944840 100644 --- a/clients/clap-first/scxt-plugin/scxt-plugin.cpp +++ b/clients/clap-first/scxt-plugin/scxt-plugin.cpp @@ -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}, @@ -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; }