We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1cf611 commit 3799d2eCopy full SHA for 3799d2e
functions.cpp
@@ -1071,8 +1071,8 @@ namespace Sass {
1071
BUILT_IN(random)
1072
{
1073
Number* l = dynamic_cast<Number*>(env["$limit"]);
1074
- if (l && trunc(l->value()) != l->value()) error("argument $limit of `" + string(sig) + "` must be an integer", pstate);
1075
if (l) {
+ if (trunc(l->value()) != l->value() || l->value() == 0) error("argument $limit of `" + string(sig) + "` must be a positive integer", pstate);
1076
uniform_real_distribution<> distributor(1, l->value() + 1);
1077
uint_fast32_t distributed = static_cast<uint_fast32_t>(distributor(rand));
1078
return new (ctx.mem) Number(pstate, (double)distributed);
0 commit comments