[PATCH] [Msvcrt]: fixing errno handling in strtol and strtoul (#18151)

Alexandre Julliard julliard at winehq.org
Mon Aug 31 05:03:11 CDT 2009


Eric Pouech <eric.pouech at orange.fr> writes:

> @@ -250,3 +250,25 @@ int CDECL __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str,
>  #endif
>      return 0;
>  }
> +
> +/******************************************************************
> + *		strtol (MSVCRT.@)
> + */
> +long int MSVCRT_strtol(const char* nptr, char** end, int base)
> +{
> +    /* wrapper to forward libc error code to msvcrt's error codes */
> +    long ret = strtol(nptr, end, base);
> +    msvcrt_set_unix_errno();
> +    return ret;
> +}

You can't simply use long here, you need to handle the difference in the
size of long between Win32 and Unix.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list