fix a compile fail by strndup in RHEL5 env