[Mesa-dev] [PATCH 1/4] glsl: simplify +INF check

Vlad Golovkin vlad.golovkin.mail at gmail.com
Tue May 30 22:45:13 UTC 2017


---
 src/compiler/glsl/s_expression.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/s_expression.cpp b/src/compiler/glsl/s_expression.cpp
index f82e155a6b..0e05c4bba7 100644
--- a/src/compiler/glsl/s_expression.cpp
+++ b/src/compiler/glsl/s_expression.cpp
@@ -69,7 +69,7 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer)
    // Check for the special symbol '+INF', which means +Infinity.  Note: C99
    // requires strtof to parse '+INF' as +Infinity, but we still support some
    // non-C99-compliant compilers (e.g. MSVC).
-   if (n == 4 && strncmp(src, "+INF", 4) == 0) {
+   if (n == 4 && memcmp(src, "+INF", 4) == 0) {
       expr = new(ctx) s_float(INFINITY);
    } else {
       // Check if the atom is a number.
-- 
2.11.0



More information about the mesa-dev mailing list