Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
bab686e7
Commit
bab686e7
authored
Nov 01, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fixed %Lf format handling in scanf.
parent
8ca3e80d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
scanf.h
dlls/msvcrt/scanf.h
+1
-1
scanf.c
dlls/msvcrt/tests/scanf.c
+11
-0
No files found.
dlls/msvcrt/scanf.h
View file @
bab686e7
...
...
@@ -379,7 +379,7 @@ _FUNCTION_ {
}
st
=
1
;
if
(
!
suppress
)
{
if
(
L_prefix
)
_SET_NUMBER_
(
long
double
);
if
(
L_prefix
)
_SET_NUMBER_
(
double
);
else
if
(
l_prefix
)
_SET_NUMBER_
(
double
);
else
_SET_NUMBER_
(
float
);
}
...
...
dlls/msvcrt/tests/scanf.c
View file @
bab686e7
...
...
@@ -31,6 +31,7 @@ static void test_sscanf( void )
char
c
;
void
*
ptr
;
float
res1
=
-
82
.
6267
f
,
res2
=
27
.
76
f
,
res11
,
res12
;
double
double_res
;
static
const
char
pname
[]
=
" St. Petersburg, Florida
\n
"
;
int
hour
=
21
,
min
=
59
,
sec
=
20
;
int
number
,
number_so_far
;
...
...
@@ -99,6 +100,16 @@ static void test_sscanf( void )
ok
(
ret
==
2
,
"expected 2, got %u
\n
"
,
ret
);
ok
(
(
res11
==
res1
)
&&
(
res12
==
res2
),
"Error reading floats
\n
"
);
/* Check double */
ret
=
sprintf
(
buffer
,
"%lf"
,
32
.
715
);
ok
(
ret
==
9
,
"expected 9, got %u
\n
"
,
ret
);
ret
=
sscanf
(
buffer
,
"%lf"
,
&
double_res
);
ok
(
ret
==
1
,
"expected 1, got %u
\n
"
,
ret
);
ok
(
double_res
==
32
.
715
,
"Got %lf, expected %lf
\n
"
,
double_res
,
32
.
715
);
ret
=
sscanf
(
buffer
,
"%Lf"
,
&
double_res
);
ok
(
ret
==
1
,
"expected 1, got %u
\n
"
,
ret
);
ok
(
double_res
==
32
.
715
,
"Got %lf, expected %lf
\n
"
,
double_res
,
32
.
715
);
/* check strings */
ret
=
sprintf
(
buffer
,
" %s"
,
pname
);
ok
(
ret
==
26
,
"expected 26, got %u
\n
"
,
ret
);
...
...
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