diff --git a/include/sqrat/sqratUtil.h b/include/sqrat/sqratUtil.h index 20a13e70..b35e984e 100644 --- a/include/sqrat/sqratUtil.h +++ b/include/sqrat/sqratUtil.h @@ -1533,7 +1533,7 @@ struct StackStrF mRes = sq_throwerror(vm, "Missing string or value"); } // Do we have enough values to call the format function and are we allowed to? - else if ((top - 1) > idx && fmt) + else if (fmt && (top - 1) >= idx) { // Pointer to the generated string SQChar * str = nullptr;