Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bfa1e3ef
Commit
bfa1e3ef
authored
Jun 08, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use internal sprintf implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2680b076
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
17 deletions
+20
-17
errno.c
dlls/msvcrt/errno.c
+2
-2
exit.c
dlls/msvcrt/exit.c
+1
-1
locale.c
dlls/msvcrt/locale.c
+2
-2
math.c
dlls/msvcrt/math.c
+4
-4
mbcs.c
dlls/msvcrt/mbcs.c
+1
-1
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-0
printf.h
dlls/msvcrt/printf.h
+6
-4
string.c
dlls/msvcrt/string.c
+2
-2
undname.c
dlls/msvcrt/undname.c
+1
-1
No files found.
dlls/msvcrt/errno.c
View file @
bfa1e3ef
...
...
@@ -323,9 +323,9 @@ char* CDECL MSVCRT__strerror(const char* str)
if
(
err
<
0
||
err
>
MSVCRT__sys_nerr
)
err
=
MSVCRT__sys_nerr
;
if
(
str
&&
*
str
)
sprintf
(
data
->
strerror_buffer
,
"%s: %s
\n
"
,
str
,
MSVCRT__sys_errlist
[
err
]
);
MSVCRT_
sprintf
(
data
->
strerror_buffer
,
"%s: %s
\n
"
,
str
,
MSVCRT__sys_errlist
[
err
]
);
else
sprintf
(
data
->
strerror_buffer
,
"%s
\n
"
,
MSVCRT__sys_errlist
[
err
]
);
MSVCRT_
sprintf
(
data
->
strerror_buffer
,
"%s
\n
"
,
MSVCRT__sys_errlist
[
err
]
);
return
data
->
strerror_buffer
;
}
...
...
dlls/msvcrt/exit.c
View file @
bfa1e3ef
...
...
@@ -237,7 +237,7 @@ void CDECL _amsg_exit(int errnum)
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_DEFAULT
)
&&
(
MSVCRT_app_type
==
2
)))
{
char
text
[
32
];
sprintf
(
text
,
"Error: R60%d"
,
errnum
);
MSVCRT_
sprintf
(
text
,
"Error: R60%d"
,
errnum
);
DoMessageBox
(
"Runtime error!"
,
text
);
}
else
...
...
dlls/msvcrt/locale.c
View file @
bfa1e3ef
...
...
@@ -454,7 +454,7 @@ static BOOL update_threadlocinfo_category(LCID lcid, unsigned short cp,
len
+=
GetLocaleInfoA
(
lcid
,
LOCALE_SENGCOUNTRY
|
LOCALE_NOUSEROVERRIDE
,
&
buf
[
len
],
256
-
len
);
buf
[
len
-
1
]
=
'.'
;
sprintf
(
buf
+
len
,
"%d"
,
cp
);
MSVCRT_
sprintf
(
buf
+
len
,
"%d"
,
cp
);
len
+=
strlen
(
buf
+
len
);
return
init_category_name
(
buf
,
len
,
locinfo
,
category
);
...
...
@@ -507,7 +507,7 @@ static inline char* construct_lc_all(MSVCRT_pthreadlocinfo locinfo) {
if
(
i
==
MSVCRT_LC_MAX
)
return
locinfo
->
lc_category
[
MSVCRT_LC_COLLATE
].
locale
;
sprintf
(
current_lc_all
,
MSVCRT_
sprintf
(
current_lc_all
,
"LC_COLLATE=%s;LC_CTYPE=%s;LC_MONETARY=%s;LC_NUMERIC=%s;LC_TIME=%s"
,
locinfo
->
lc_category
[
MSVCRT_LC_COLLATE
].
locale
,
locinfo
->
lc_category
[
MSVCRT_LC_CTYPE
].
locale
,
...
...
dlls/msvcrt/math.c
View file @
bfa1e3ef
...
...
@@ -1735,7 +1735,7 @@ char * CDECL MSVCRT__ecvt( double number, int ndigits, int *decpt, int *sign )
/* handle cases with zero ndigits or less */
prec
=
ndigits
;
if
(
prec
<
1
)
prec
=
2
;
len
=
snprintf
(
data
->
efcvt_buffer
,
80
,
"%.*le"
,
prec
-
1
,
number
);
len
=
MSVCRT__
snprintf
(
data
->
efcvt_buffer
,
80
,
"%.*le"
,
prec
-
1
,
number
);
/* take the decimal "point away */
if
(
prec
!=
1
)
memmove
(
data
->
efcvt_buffer
+
1
,
data
->
efcvt_buffer
+
2
,
len
-
1
);
...
...
@@ -1795,7 +1795,7 @@ int CDECL MSVCRT__ecvt_s( char *buffer, MSVCRT_size_t length, double number, int
number
=
-
number
;
}
else
*
sign
=
FALSE
;
len
=
snprintf
(
result
,
prec
+
7
,
"%.*le"
,
prec
-
1
,
number
);
len
=
MSVCRT__
snprintf
(
result
,
prec
+
7
,
"%.*le"
,
prec
-
1
,
number
);
/* take the decimal "point away */
if
(
prec
!=
1
)
memmove
(
result
+
1
,
result
+
2
,
len
-
1
);
...
...
@@ -1837,7 +1837,7 @@ char * CDECL MSVCRT__fcvt( double number, int ndigits, int *decpt, int *sign )
number
=
-
number
;
}
else
*
sign
=
0
;
stop
=
snprintf
(
buf
,
80
,
"%.*f"
,
ndigits
<
0
?
0
:
ndigits
,
number
);
stop
=
MSVCRT__
snprintf
(
buf
,
80
,
"%.*f"
,
ndigits
<
0
?
0
:
ndigits
,
number
);
ptr1
=
buf
;
ptr2
=
data
->
efcvt_buffer
;
first
=
NULL
;
...
...
@@ -1920,7 +1920,7 @@ int CDECL MSVCRT__fcvt_s(char* outbuffer, MSVCRT_size_t size, double number, int
number
=
-
number
;
}
else
*
sign
=
0
;
stop
=
snprintf
(
buf
,
80
,
"%.*f"
,
ndigits
<
0
?
0
:
ndigits
,
number
);
stop
=
MSVCRT__
snprintf
(
buf
,
80
,
"%.*f"
,
ndigits
<
0
?
0
:
ndigits
,
number
);
ptr1
=
buf
;
ptr2
=
outbuffer
;
first
=
NULL
;
...
...
dlls/msvcrt/mbcs.c
View file @
bfa1e3ef
...
...
@@ -239,7 +239,7 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo)
}
if
(
lcid
==
-
1
)
{
sprintf
(
bufA
,
format
,
newcp
);
MSVCRT_
sprintf
(
bufA
,
format
,
newcp
);
mbcinfo
->
mblcid
=
MSVCRT_locale_to_LCID
(
bufA
,
NULL
,
NULL
);
}
else
{
mbcinfo
->
mblcid
=
lcid
;
...
...
dlls/msvcrt/msvcrt.h
View file @
bfa1e3ef
...
...
@@ -1191,6 +1191,7 @@ int __cdecl MSVCRT_strcmp(const char*, const char*);
char
*
__cdecl
MSVCRT_strstr
(
const
char
*
,
const
char
*
);
unsigned
int
__cdecl
MSVCRT__get_output_format
(
void
);
char
*
__cdecl
MSVCRT_strtok_s
(
char
*
,
const
char
*
,
char
**
);
char
*
__cdecl
MSVCRT__itoa
(
int
,
char
*
,
int
);
double
parse_double
(
MSVCRT_wchar_t
(
*
)(
void
*
),
void
(
*
)(
void
*
),
void
*
,
MSVCRT_pthreadlocinfo
,
int
*
);
/* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
...
...
dlls/msvcrt/printf.h
View file @
bfa1e3ef
...
...
@@ -282,7 +282,9 @@ static inline void FUNC_NAME(pf_rebuild_format_string)(char *p, FUNC_NAME(pf_fla
if
(
flags
->
Alternate
)
*
p
++
=
flags
->
Alternate
;
if
(
flags
->
Precision
>=
0
)
{
p
+=
sprintf
(
p
,
".%d"
,
flags
->
Precision
);
*
p
++
=
'.'
;
MSVCRT__itoa
(
flags
->
Precision
,
p
,
10
);
p
+=
strlen
(
p
);
}
*
p
++
=
flags
->
Format
;
*
p
++
=
0
;
...
...
@@ -663,11 +665,11 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
static
const
char
ind_str
[]
=
"nan(ind)"
;
static
const
char
nan_str
[]
=
"nan"
;
if
(
inf
)
sprintf
(
tmp
,
inf_str
);
memcpy
(
tmp
,
inf_str
,
ARRAY_SIZE
(
inf_str
)
);
else
if
(
ind
)
sprintf
(
tmp
,
ind_str
);
memcpy
(
tmp
,
ind_str
,
ARRAY_SIZE
(
ind_str
)
);
else
sprintf
(
tmp
,
nan_str
);
memcpy
(
tmp
,
nan_str
,
ARRAY_SIZE
(
nan_str
)
);
if
(
strchr
(
"EFG"
,
flags
.
Format
))
for
(
i
=
0
;
tmp
[
i
];
i
++
)
tmp
[
i
]
=
MSVCRT__toupper_l
(
tmp
[
i
],
NULL
);
...
...
dlls/msvcrt/string.c
View file @
bfa1e3ef
...
...
@@ -2301,8 +2301,8 @@ int CDECL MSVCRT_I10_OUTPUT(MSVCRT__LDOUBLE ld80, int prec, int flag, struct _I1
prec
=
0
;
}
sprintf
(
format
,
"%%.%dle"
,
prec
);
sprintf
(
buf
,
format
,
d
);
MSVCRT_
sprintf
(
format
,
"%%.%dle"
,
prec
);
MSVCRT_
sprintf
(
buf
,
format
,
d
);
buf
[
1
]
=
buf
[
0
];
data
->
pos
=
atoi
(
buf
+
prec
+
3
);
...
...
dlls/msvcrt/undname.c
View file @
bfa1e3ef
...
...
@@ -331,7 +331,7 @@ static const char* get_number(struct parsed_symbol* sym)
if
(
*
sym
->
current
!=
'@'
)
return
NULL
;
ptr
=
und_alloc
(
sym
,
17
);
sprintf
(
ptr
,
"%s%u"
,
sgn
?
"-"
:
""
,
ret
);
MSVCRT_
sprintf
(
ptr
,
"%s%u"
,
sgn
?
"-"
:
""
,
ret
);
sym
->
current
++
;
}
else
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment