Commit 96af7de7 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Avoid message expansion in if --strict is used.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 9319342a
......@@ -223,7 +223,7 @@ parse_payload (const string& bits)
error ("audiowmark: cannot parse bits '%s'\n", bits.c_str());
return {};
}
if (Params::payload_short && bitvec.size() != Params::payload_size)
if ((Params::payload_short || Params::strict) && bitvec.size() != Params::payload_size)
{
error ("audiowmark: number of message bits must match payload size (%zd bits)\n", Params::payload_size);
return {};
......@@ -235,7 +235,7 @@ parse_payload (const string& bits)
}
if (bitvec.size() < Params::payload_size)
{
/* expand message automatically; good for testing, maybe not so good for the final product */
/* expand message automatically; good for testing, not so good in production (disabled by --strict) */
vector<int> expanded_bitvec;
for (size_t i = 0; i < Params::payload_size; i++)
expanded_bitvec.push_back (bitvec[i % bitvec.size()]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment