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
fbe6b57b
Commit
fbe6b57b
authored
Nov 01, 2009
by
André Hentschel
Committed by
Alexandre Julliard
Nov 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Do not overlap in strcpy (Valgrind).
parent
5f0940e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
math.c
dlls/msvcrt/math.c
+3
-3
No files found.
dlls/msvcrt/math.c
View file @
fbe6b57b
...
@@ -836,7 +836,7 @@ double CDECL _nextafter(double num, double next)
...
@@ -836,7 +836,7 @@ double CDECL _nextafter(double num, double next)
*/
*/
char
*
CDECL
_ecvt
(
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
char
*
CDECL
_ecvt
(
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
)
{
{
int
prec
;
int
prec
,
len
;
thread_data_t
*
data
=
msvcrt_get_thread_data
();
thread_data_t
*
data
=
msvcrt_get_thread_data
();
/* FIXME: check better for overflow (native supports over 300 chars's) */
/* FIXME: check better for overflow (native supports over 300 chars's) */
ndigits
=
min
(
ndigits
,
80
-
7
);
/* 7 : space for dec point, 1 for "e",
ndigits
=
min
(
ndigits
,
80
-
7
);
/* 7 : space for dec point, 1 for "e",
...
@@ -853,10 +853,10 @@ char * CDECL _ecvt( double number, int ndigits, int *decpt, int *sign )
...
@@ -853,10 +853,10 @@ char * CDECL _ecvt( double number, int ndigits, int *decpt, int *sign )
/* handle cases with zero ndigits or less */
/* handle cases with zero ndigits or less */
prec
=
ndigits
;
prec
=
ndigits
;
if
(
prec
<
1
)
prec
=
2
;
if
(
prec
<
1
)
prec
=
2
;
snprintf
(
data
->
efcvt_buffer
,
80
,
"%.*le"
,
prec
-
1
,
number
);
len
=
snprintf
(
data
->
efcvt_buffer
,
80
,
"%.*le"
,
prec
-
1
,
number
);
/* take the decimal "point away */
/* take the decimal "point away */
if
(
prec
!=
1
)
if
(
prec
!=
1
)
strcpy
(
data
->
efcvt_buffer
+
1
,
data
->
efcvt_buffer
+
2
);
memmove
(
data
->
efcvt_buffer
+
1
,
data
->
efcvt_buffer
+
2
,
len
-
1
);
/* take the exponential "e" out */
/* take the exponential "e" out */
data
->
efcvt_buffer
[
prec
]
=
'\0'
;
data
->
efcvt_buffer
[
prec
]
=
'\0'
;
/* read the exponent */
/* read the exponent */
...
...
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