Change size of label on line 449 to avoid incorrect compiler warning about label's maximum length

This commit is contained in:
Taylor Rose
2018-10-31 16:42:02 -04:00
committed by Taylor Hoff
parent 744147fd94
commit 193e0c812c

View File

@ -446,7 +446,7 @@ static void error(Compiler* compiler, const char* format, ...)
else
{
// Make sure we don't exceed the buffer with a very long token.
char label[ERROR_MESSAGE_SIZE];
char label[10 + MAX_VARIABLE_NAME + 4 + 1];
if (token->length <= MAX_VARIABLE_NAME)
{
sprintf(label, "Error at '%.*s'", token->length, token->start);