summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/knobs_init.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/knobs_init.h b/src/gallium/drivers/swr/rasterizer/core/knobs_init.h
index adf738c1bed..ba2df2292f0 100644
--- a/src/gallium/drivers/swr/rasterizer/core/knobs_init.h
+++ b/src/gallium/drivers/swr/rasterizer/core/knobs_init.h
@@ -38,7 +38,9 @@ template <typename T>
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);
}
@@ -64,10 +66,11 @@ static inline void ConvertEnvToKnob(const char* pOverride, bool& knobValue)
// 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;
}
}