]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
sscanf -> sscanf_s on windows
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index 29b3018916b4f93f3f74b5235b7cf108beb05695..606ef5a9fee5cf768864d6a31e3cb84e5fe96c1a 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -627,6 +627,7 @@ int lex_do(lex_file *lex)
                         !strcmp(v, "if")     ||
                         !strcmp(v, "else")   ||
                         !strcmp(v, "var")    ||
+                        !strcmp(v, "local")  ||
                         !strcmp(v, "return") ||
                         !strcmp(v, "const"))
                        lex->tok->ttype = TOKEN_KEYWORD;
@@ -665,7 +666,13 @@ int lex_do(lex_file *lex)
                         return (lex->tok->ttype = TOKEN_FATAL);
 
                 /* It's a vector if we can successfully scan 3 floats */
-                if (sscanf(lex->tok->value, " %f %f %f ", &lex->tok->constval.v.x, &lex->tok->constval.v.y, &lex->tok->constval.v.z) == 3)
+#ifdef WIN32
+                if (sscanf_s(lex->tok->value, " %f %f %f ",
+                           &lex->tok->constval.v.x, &lex->tok->constval.v.y, &lex->tok->constval.v.z) == 3)
+#else
+                if (sscanf(lex->tok->value, " %f %f %f ",
+                           &lex->tok->constval.v.x, &lex->tok->constval.v.y, &lex->tok->constval.v.z) == 3)
+#endif
                 {
                         lex->tok->ttype = TOKEN_VECTORCONST;
                 }