If `copied` is `MAX_PATH`, this is an out-of-bounds access. And you should probably handle a failed conversion, too.

Also, shouldn't there be similar asserts everywhere else?