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
638c8e38
Commit
638c8e38
authored
Jan 16, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't overwrite unmatched string in scanf.
parent
7341996f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
scanf.h
dlls/msvcrt/scanf.h
+2
-2
scanf.c
dlls/msvcrt/tests/scanf.c
+7
-0
No files found.
dlls/msvcrt/scanf.h
View file @
638c8e38
...
...
@@ -478,7 +478,7 @@ _FUNCTION_ {
if
(
width
>
0
)
width
--
;
}
/* terminate */
if
(
!
suppress
)
*
sptr
=
0
;
if
(
st
&&
!
suppress
)
*
sptr
=
0
;
}
break
;
widecharstring
:
{
/* read a word into a wchar_t* */
...
...
@@ -508,7 +508,7 @@ _FUNCTION_ {
if
(
width
>
0
)
width
--
;
}
/* terminate */
if
(
!
suppress
)
*
sptr
=
0
;
if
(
st
&&
!
suppress
)
*
sptr
=
0
;
}
break
;
/* 'c' and 'C work analogously to 's' and 'S' as described
...
...
dlls/msvcrt/tests/scanf.c
View file @
638c8e38
...
...
@@ -131,6 +131,13 @@ static void test_sscanf( void )
ok
(
ret
==
1
,
"Error with format
\"
%s
\"\n
"
,
"%*[a-cd-dg-e]%c"
);
ok
(
buffer
[
0
]
==
'h'
,
"Error with
\"
abcefgdh
\"
\"
%c
\"\n
"
,
buffer
[
0
]);
buffer1
[
0
]
=
'b'
;
ret
=
sscanf
(
"a"
,
"%s%s"
,
buffer
,
buffer1
);
ok
(
ret
==
1
,
"expected 1, got %u
\n
"
,
ret
);
ok
(
buffer
[
0
]
==
'a'
,
"buffer[0] = '%c'
\n
"
,
buffer
[
0
]);
ok
(
buffer
[
1
]
==
'\0'
,
"buffer[1] = '%c'
\n
"
,
buffer
[
1
]);
ok
(
buffer1
[
0
]
==
'b'
,
"buffer1[0] = '%c'
\n
"
,
buffer1
[
0
]);
/* check digits */
ret
=
sprintf
(
buffer
,
"%d:%d:%d"
,
hour
,
min
,
sec
);
ok
(
ret
==
8
,
"expected 8, 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