X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=lexer.c;h=606ef5a9fee5cf768864d6a31e3cb84e5fe96c1a;hb=812cb5be649c863e8d12289d858b15de60e86fd4;hp=29b3018916b4f93f3f74b5235b7cf108beb05695;hpb=e3b3c2efe3a52dd22229927df319d80262bed2f1;p=xonotic%2Fgmqcc.git diff --git a/lexer.c b/lexer.c index 29b3018..606ef5a 100644 --- 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; }