src: Use memcpy rather than memset and a loop

Speeds up the program a bit :)