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
4e5c51a6
Commit
4e5c51a6
authored
Aug 22, 2006
by
Andrzej Popowski
Committed by
Alexandre Julliard
Aug 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix scanf format "%i" base detection.
parent
803f3bd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
scanf.h
dlls/msvcrt/scanf.h
+4
-1
scanf.c
dlls/msvcrt/tests/scanf.c
+12
-0
No files found.
dlls/msvcrt/scanf.h
View file @
4e5c51a6
...
...
@@ -169,7 +169,7 @@ _FUNCTION_ {
base
=
10
;
goto
number
;
case
'i'
:
/* generic integer */
base
=
1
0
;
base
=
0
;
number
:
{
/* read an integer */
ULONGLONG
cur
=
0
;
...
...
@@ -200,6 +200,9 @@ _FUNCTION_ {
}
else
if
(
base
==
0
)
base
=
8
;
}
/* format %i without indication of base */
if
(
base
==
0
)
base
=
10
;
/* throw away leading zeros */
while
(
width
!=
0
&&
nch
==
'0'
)
{
nch
=
_GETC_
(
file
);
...
...
dlls/msvcrt/tests/scanf.c
View file @
4e5c51a6
...
...
@@ -110,6 +110,18 @@ static void test_sscanf( void )
ok
(
ret
==
1
,
"Wrong number of arguments read: %d (expected 1)
\n
"
,
ret
);
ok
(
result
==
-
1
,
"Read %d, expected -1
\n
"
,
result
);
/* Check %i for octal and hexadecimal input */
result
=
0
;
strcpy
(
buffer
,
"017"
);
ret
=
sscanf
(
buffer
,
"%i"
,
&
result
);
ok
(
ret
==
1
,
"Wrong number of arguments read: %d
\n
"
,
ret
);
ok
(
result
==
15
,
"Wrong number read
\n
"
);
result
=
0
;
strcpy
(
buffer
,
"0x17"
);
ret
=
sscanf
(
buffer
,
"%i"
,
&
result
);
ok
(
ret
==
1
,
"Wrong number of arguments read: %d
\n
"
,
ret
);
ok
(
result
==
23
,
"Wrong number read
\n
"
);
/* %o */
result
=
0
;
ret
=
sscanf
(
"-1"
,
"%o"
,
&
result
);
...
...
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