]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
sscanf -> sscanf_s on windows
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 11:44:53 +0000 (13:44 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 11:44:53 +0000 (13:44 +0200)
lexer.c

diff --git a/lexer.c b/lexer.c
index 0fa25f79b309a43eb3c6e62396a3cddf69d7f967..606ef5a9fee5cf768864d6a31e3cb84e5fe96c1a 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -666,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;
                 }