msvcrt: Fix precision handling for string arguments.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3eb0d2868c
commit
2a2f525eb3
|
@ -1094,6 +1094,8 @@ char*** __cdecl MSVCRT___p__environ(void);
|
|||
int* __cdecl __p___mb_cur_max(void);
|
||||
unsigned int* __cdecl __p__fmode(void);
|
||||
MSVCRT_wchar_t* __cdecl MSVCRT__wcsdup(const MSVCRT_wchar_t*);
|
||||
MSVCRT_size_t __cdecl MSVCRT_strnlen(const char *,MSVCRT_size_t);
|
||||
MSVCRT_size_t __cdecl MSVCRT_wcsnlen(const MSVCRT_wchar_t*,MSVCRT_size_t);
|
||||
MSVCRT_wchar_t*** __cdecl MSVCRT___p__wenviron(void);
|
||||
INT __cdecl MSVCRT_wctomb(char*,MSVCRT_wchar_t);
|
||||
char* __cdecl MSVCRT__strdate(char* date);
|
||||
|
|
|
@ -165,8 +165,13 @@ static inline int FUNC_NAME(pf_output_format_wstr)(FUNC_NAME(puts_clbk) pf_puts,
|
|||
{
|
||||
int r, ret;
|
||||
|
||||
if(len < 0)
|
||||
len = strlenW(str);
|
||||
if(len < 0) {
|
||||
/* Do not search past the length specified by the precision. */
|
||||
if(flags->Precision>=0)
|
||||
len = MSVCRT_wcsnlen(str, flags->Precision);
|
||||
else
|
||||
len = strlenW(str);
|
||||
}
|
||||
|
||||
if(flags->Precision>=0 && flags->Precision<len)
|
||||
len = flags->Precision;
|
||||
|
@ -190,8 +195,13 @@ static inline int FUNC_NAME(pf_output_format_str)(FUNC_NAME(puts_clbk) pf_puts,
|
|||
{
|
||||
int r, ret;
|
||||
|
||||
if(len < 0)
|
||||
len = strlen(str);
|
||||
if(len < 0) {
|
||||
/* Do not search past the length specified by the precision. */
|
||||
if(flags->Precision>=0)
|
||||
len = MSVCRT_strnlen(str, flags->Precision);
|
||||
else
|
||||
len = strlen(str);
|
||||
}
|
||||
|
||||
if(flags->Precision>=0 && flags->Precision<len)
|
||||
len = flags->Precision;
|
||||
|
|
Loading…
Reference in New Issue