Skip to content

Commit f5afaae

Browse files
committed
fix(zscript): remove bogus error log when using ArrayCopy
1 parent fe45f67 commit f5afaae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/zc/ffscript.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,16 +2240,16 @@ class ArrayH : public SH
22402240
}
22412241
}
22422242

2243-
static void copyValues(const int32_t ptr, const int32_t ptr2, size_t num_values)
2243+
static void copyValues(const int32_t ptr, const int32_t ptr2)
22442244
{
22452245
ArrayManager am1(ptr), am2(ptr2);
22462246
if(am1.invalid() || am2.invalid())
22472247
return;
2248-
size_t sz = std::min(am1.size(),am2.size());
2249-
for(word i = 0; (BC::checkUserArrayIndex(i, sz) == _NoError) && num_values != 0; i++)
2248+
2249+
int sz = std::min(am1.size(),am2.size());
2250+
for (int i = 0; i < sz; i++)
22502251
{
22512252
am1.set(i,am2.get(i));
2252-
num_values--;
22532253
}
22542254
}
22552255
//Get element from array
@@ -44566,7 +44566,7 @@ void FFScript::do_arraycpy(const bool a, const bool b)
4456644566
{
4456744567
int32_t arrayptr_dest = SH::get_arg(sarg1, a) / 10000;
4456844568
int32_t arrayptr_src = SH::get_arg(sarg2, b) / 10000;
44569-
ArrayH::copyValues(arrayptr_dest, arrayptr_src, ArrayH::getSize(arrayptr_src));
44569+
ArrayH::copyValues(arrayptr_dest, arrayptr_src);
4457044570
}
4457144571
void FFScript::do_strlen(const bool v)
4457244572
{

0 commit comments

Comments
 (0)