Module: wine Branch: master Commit: 16c89a543a3b018da4018dc982c70ff2f4f005c1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=16c89a543a3b018da4018dc982...
Author: Eric Pouech eric.pouech@orange.fr Date: Fri Oct 29 15:39:30 2010 +0200
msvcrt: Use parameter checking macros for wcsto{number} functions.
---
dlls/msvcrt/wcs.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index d7d2fd4..3dcfa1a 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -135,8 +135,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end, double ret; BOOL found_digit = FALSE;
- if(!str) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(str != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return 0; } @@ -1642,8 +1641,9 @@ __int64 CDECL MSVCRT__wcstoi64_l(const MSVCRT_wchar_t *nptr,
TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
- if(!nptr || base<0 || base>36 || base==1) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(nptr != NULL) || !MSVCRT_CHECK_PMT(base == 0 || base >= 2) || + !MSVCRT_CHECK_PMT(base <= 36)) { + *MSVCRT__errno() = MSVCRT_EINVAL; return 0; }
@@ -1724,8 +1724,9 @@ unsigned __int64 CDECL MSVCRT__wcstoui64_l(const MSVCRT_wchar_t *nptr,
TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
- if(!nptr || base<0 || base>36 || base==1) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(nptr != NULL) || !MSVCRT_CHECK_PMT(base == 0 || base >= 2) || + !MSVCRT_CHECK_PMT(base <= 36)) { + *MSVCRT__errno() = MSVCRT_EINVAL; return 0; }