2007-03-14 20:24:57 +00:00
|
|
|
#include <precomp.h>
|
2006-11-08 11:47:44 +00:00
|
|
|
|
2016-05-24 19:27:57 +00:00
|
|
|
/* Based on Wine Staging 1.9.9 - dlls/msvcrt/string.c */
|
2015-06-01 18:49:52 +00:00
|
|
|
/******************************************************************
|
|
|
|
* _strtoul_l (MSVCRT.@)
|
|
|
|
*/
|
2016-06-01 07:07:57 +00:00
|
|
|
unsigned long CDECL _strtoul_l(const char* nptr, char** end, int base, _locale_t locale)
|
2015-06-01 18:49:52 +00:00
|
|
|
{
|
2016-06-01 07:07:57 +00:00
|
|
|
__int64 ret = _strtoi64_l(nptr, end, base, locale);
|
2015-06-01 18:49:52 +00:00
|
|
|
|
|
|
|
if(ret > ULONG_MAX) {
|
|
|
|
ret = ULONG_MAX;
|
|
|
|
#ifndef _LIBCNT_
|
|
|
|
*_errno() = ERANGE;
|
|
|
|
#endif
|
|
|
|
}else if(ret < -(__int64)ULONG_MAX) {
|
|
|
|
ret = 1;
|
2009-10-16 21:29:27 +00:00
|
|
|
#ifndef _LIBCNT_
|
2015-06-01 18:49:52 +00:00
|
|
|
*_errno() = ERANGE;
|
2009-10-16 21:29:27 +00:00
|
|
|
#endif
|
2015-06-01 18:49:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* strtoul (MSVCRT.@)
|
|
|
|
*/
|
|
|
|
unsigned long CDECL strtoul(const char* nptr, char** end, int base)
|
|
|
|
{
|
2016-06-01 07:07:57 +00:00
|
|
|
return _strtoul_l(nptr, end, base, NULL);
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|