fix duplocale clobbering of new locale struct with memcpy of old
when the non-stub duplocale code was added as part of the locale framework in commit 0bc03091, the old code to memcpy the old locale object to the new one was left behind. the conditional for the memcpy no longer makes sense, because the conditions are now always-true when it's reached, and the memcpy is wrong because it clobbers the new->messages_name pointer setup just above. since the messages_name and ctype_utf8 members have already been copied, all that remains is the cat[] array. these pointers are volatile, so using memcpy to copy them is formally wrong; use a for loop instead.
Showing
想要评论请 注册 或 登录