(Silently) ignore invalid -l loglevel specs. This avoids a crash
reported in bug #1071.
case 'l':
{
const int loglevel = atoi(optarg);
case 'l':
{
const int loglevel = atoi(optarg);
+ if (loglevel < 0 || loglevel > 5) {
+ qDebug() << "ERROR: invalid log level spec.";
+ break;
+ }
context->set_log_level(sigrok::LogLevel::get(loglevel));
#ifdef ENABLE_DECODE
context->set_log_level(sigrok::LogLevel::get(loglevel));
#ifdef ENABLE_DECODE