Thanks. Yep, your fix is correct.
rUtf16Size is `int*`, we assign `long` to `int` will also lose accuracy