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
29c7e32f
Commit
29c7e32f
authored
May 13, 2003
by
Uwe Bonnes
Committed by
Alexandre Julliard
May 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some sscanf cases and testcase to get wxtide32.exe running.
parent
5d6f328e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
scanf.h
dlls/msvcrt/scanf.h
+7
-7
scanf.c
dlls/msvcrt/tests/scanf.c
+14
-1
No files found.
dlls/msvcrt/scanf.h
View file @
29c7e32f
...
...
@@ -4,7 +4,7 @@
*
* Copyright 1996,1998 Marcus Meissner
* Copyright 1996 Jukka Iivonen
* Copyright 1997,2000 Uwe Bonnes
* Copyright 1997,2000
, 2003
Uwe Bonnes
* Copyright 2000 Jon Griffiths
* Copyright 2002 Daniel Gudbjartsson
*
...
...
@@ -82,12 +82,12 @@ int _FUNCTION_ {
if
(
!*
format
)
return
0
;
#ifndef WIDE_SCANF
#ifdef CONSOLE
WARN
(
"(
\"
%s
\"
): semi-stub
\n
"
,
format
);
WARN
(
"(
%s): semi-stub
\n
"
,
debugstr_a
(
format
)
);
#else
/* CONSOLE */
#ifdef STRING
WARN
(
"%s (
\"
%s
\"
): semi-stub
\n
"
,
file
,
format
);
WARN
(
"%s (
%s): semi-stub
\n
"
,
file
,
debugstr_a
(
format
)
);
#else
/* STRING */
WARN
(
"%p (
\"
%s
\"
): semi-stub
\n
"
,
file
,
format
);
WARN
(
"%p (
%s): semi-stub
\n
"
,
file
,
debugstr_a
(
format
)
);
#endif
/* STRING */
#endif
/* CONSOLE */
#endif
/* WIDE_SCANF */
...
...
@@ -260,7 +260,7 @@ int _FUNCTION_ {
}
/* get first digit. */
if
(
!
_ISDIGIT_
(
nch
))
break
;
cur
=
(
nch
-
'0'
)
*
(
negative
?
-
1
:
1
)
;
cur
=
(
nch
-
'0'
);
nch
=
_GETC_
(
file
);
if
(
width
>
0
)
width
--
;
/* read until no more digits */
...
...
@@ -409,8 +409,8 @@ int _FUNCTION_ {
#else
/* WIDE_SCANF */
*
c
=
nch
;
#endif
/* WIDE_SCANF */
st
=
1
;
}
st
=
1
;
nch
=
_GETC_
(
file
);
}
break
;
...
...
@@ -422,9 +422,9 @@ int _FUNCTION_ {
#else
/* WIDE_SCANF */
*
c
=
_CONVERT_
(
nch
);
#endif
/* WIDE_SCANF */
st
=
1
;
}
nch
=
_GETC_
(
file
);
st
=
1
;
}
break
;
case
'n'
:
{
...
...
dlls/msvcrt/tests/scanf.c
View file @
29c7e32f
...
...
@@ -24,9 +24,12 @@
static
void
test_sscanf
(
void
)
{
char
buffer
[
100
];
char
buffer
[
100
]
,
buffer1
[
100
]
;
char
format
[
20
];
int
result
,
ret
;
float
res1
=
-
82
.
6267
,
res2
=
27
.
76
,
res11
,
res12
;
char
pname
[]
=
" St. Petersburg, Florida
\n
"
;
/* check EOF */
strcpy
(
buffer
,
""
);
...
...
@@ -51,6 +54,16 @@ static void test_sscanf( void )
strcpy
(
format
,
"%
\"
%%%d%@"
);
/* work around gcc format check */
ok
(
sscanf
(
buffer
,
format
,
&
result
)
==
1
,
"sscanf failed"
);
ok
(
result
==
12
,
"sscanf reads %x instead of %x"
,
result
,
12
);
/*Check float */
ret
=
sprintf
(
buffer
,
"%f %f"
,
res1
,
res2
);
ret
=
sscanf
(
buffer
,
"%f%f"
,
&
res11
,
&
res12
);
ok
(
(
res11
==
res1
)
&&
(
res12
==
res2
),
"Error reading floats"
);
ret
=
sprintf
(
buffer
,
" %s"
,
pname
);
ret
=
sscanf
(
buffer
,
"%*c%[^
\n
]"
,
buffer1
);
ok
(
ret
=
1
,
"Error with format
\"
%s
\"
"
,
"%*c%[^
\n
]"
);
ok
(
strncmp
(
pname
,
buffer1
,
strlen
(
buffer1
))
==
0
,
"Error with
\"
%s
\"
\"
%s
\"
"
,
pname
,
buffer1
);
}
...
...
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