static inline void ConvertEnvToKnob(const char* pOverride, T& knobValue)
{
uint32_t value = 0;
- if (sscanf(pOverride, "%u", &value))
+ char* pStopped = nullptr;
+ value = strtoul(pOverride, &pStopped, 0);
+ if (pStopped != pOverride)
{
knobValue = static_cast<T>(value);
}
// Try converting to a number and casting to bool
uint32_t value = 0;
- if (sscanf(pOverride, "%u", &value))
+ char* pStopped = nullptr;
+ value = strtoul(pOverride, &pStopped, 0);
+ if (pStopped != pOverride)
{
knobValue = value != 0;
- return;
}
}