Commit 520cbc6f authored by Kirill Smelkov's avatar Kirill Smelkov

lib/mem: Allow memcpy destination to be bigger than source

i.e. it is ok to copy smaller data into larger buffer.
parent a35106c2
......@@ -36,7 +36,7 @@ def memset(buf, c):
# precondition: len(dst) == len(src)
def memcpy(dst, src):
l = len(src)
assert len(dst) == l
assert len(dst) >= l
adst = ndarray(l, buffer=dst, dtype=uint8)
asrc = ndarray(l, buffer=src, dtype=uint8)
copyto(adst, asrc)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment