[common] option: return NAN when float option doesn't exist

false is not a float value.
This commit is contained in:
Quantum 2021-08-28 06:04:46 -04:00 committed by Geoffrey McRae
parent 5225d2e97f
commit 0c27111260

View File

@ -23,6 +23,7 @@
#include "common/stringutils.h"
#include <ctype.h>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
@ -799,7 +800,7 @@ float option_get_float(const char * module, const char * name)
if (!o)
{
DEBUG_ERROR("BUG: Failed to get the value for option %s:%s", module, name);
return false;
return NAN;
}
DEBUG_ASSERT(o->type == OPTION_TYPE_FLOAT);
return o->value.x_float;