最新的转vs2008时,发现atoi atoi64 截断问题,查询msdn:
In Visual C++ 2005, in the case of overflow with large negative integral values, LONG_MIN is returned. atoi and _wtoi return INT_MAX and INT_MIN on these conditions. In all out-of-range cases, errno is set to ERANGE. If the parameter passed in is NULL, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions set errno to EINVAL and return 0.
In Visual C++ 2005, in the case of overflow with large positive integral values, _atoi64 returns I64_MAX and I64_MIN in the case of overflow with large negative integral values.
用_strtoi64、_strtoui64代替atoi atoi64 可解决问题。