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
ee603ce6
Commit
ee603ce6
authored
Jan 14, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Make snprintf and snwprintf use the msvcrt version of printf.
Remove todos from tests that succeed now.
parent
ad8cb613
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
19 deletions
+37
-19
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
printf.c
dlls/msvcrt/tests/printf.c
+8
-14
wcs.c
dlls/msvcrt/wcs.c
+27
-3
No files found.
dlls/msvcrt/msvcrt.spec
View file @
ee603ce6
...
...
@@ -433,8 +433,8 @@
@ cdecl _setmode(long long)
@ stub _setsystime #(ptr long)
@ cdecl _sleep(long)
@ varargs _snprintf(str long str) snprintf
@ varargs _snwprintf(wstr long wstr)
ntdll.
_snwprintf
@ varargs _snprintf(str long str)
MSVCRT__
snprintf
@ varargs _snwprintf(wstr long wstr)
MSVCRT_
_snwprintf
@ varargs _sopen(str long long) MSVCRT__sopen
@ varargs _spawnl(long str str)
@ varargs _spawnle(long str str)
...
...
dlls/msvcrt/tests/printf.c
View file @
ee603ce6
...
...
@@ -496,16 +496,12 @@ static void test_snprintf (void)
struct
snprintf_test
{
const
char
*
format
;
int
expected
;
struct
{
int
retval
;
int
render
;
}
todo
;
};
/* Pre-2.1 libc behaviour, not C99 compliant. */
const
struct
snprintf_test
tests
[]
=
{{
"short"
,
5
,
{
0
,
0
}
},
{
"justfit"
,
7
,
{
0
,
0
}
},
{
"justfits"
,
8
,
{
0
,
1
}
},
{
"muchlonger"
,
-
1
,
{
1
,
1
}
}};
const
struct
snprintf_test
tests
[]
=
{{
"short"
,
5
},
{
"justfit"
,
7
},
{
"justfits"
,
8
},
{
"muchlonger"
,
-
1
}};
char
buffer
[
8
];
const
int
bufsiz
=
sizeof
buffer
;
unsigned
int
i
;
...
...
@@ -516,12 +512,10 @@ static void test_snprintf (void)
const
int
n
=
_snprintf
(
buffer
,
bufsiz
,
fmt
);
const
int
valid
=
n
<
0
?
bufsiz
:
(
n
==
bufsiz
?
n
:
n
+
1
);
todo
(
tests
[
i
].
todo
.
retval
?
"wine"
:
"none"
)
ok
(
n
==
expect
,
"
\"
%s
\"
: expected %d, returned %d
\n
"
,
fmt
,
expect
,
n
);
todo
(
tests
[
i
].
todo
.
render
?
"wine"
:
"none"
)
ok
(
!
memcmp
(
fmt
,
buffer
,
valid
),
"
\"
%s
\"
: rendered
\"
%.*s
\"\n
"
,
fmt
,
valid
,
buffer
);
ok
(
n
==
expect
,
"
\"
%s
\"
: expected %d, returned %d
\n
"
,
fmt
,
expect
,
n
);
ok
(
!
memcmp
(
fmt
,
buffer
,
valid
),
"
\"
%s
\"
: rendered
\"
%.*s
\"\n
"
,
fmt
,
valid
,
buffer
);
};
}
...
...
dlls/msvcrt/wcs.c
View file @
ee603ce6
...
...
@@ -712,9 +712,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
/* check we reached the end, and null terminate the string */
assert
(
*
p
==
0
);
r
=
pf_output_stringW
(
out
,
p
,
1
);
if
(
r
<
0
)
return
r
;
pf_output_stringW
(
out
,
p
,
1
);
return
out
->
used
-
1
;
}
...
...
@@ -750,6 +748,19 @@ int MSVCRT_vsnprintf( char *str, unsigned int len,
}
/*********************************************************************
* _snprintf (MSVCRT.@)
*/
int
MSVCRT__snprintf
(
char
*
str
,
unsigned
int
len
,
const
char
*
format
,
...)
{
int
retval
;
va_list
valist
;
va_start
(
valist
,
format
);
retval
=
MSVCRT_vsnprintf
(
str
,
len
,
format
,
valist
);
va_end
(
valist
);
return
retval
;
}
/*********************************************************************
* _vsnwsprintf (MSVCRT.@)
*/
int
MSVCRT_vsnwprintf
(
MSVCRT_wchar_t
*
str
,
unsigned
int
len
,
...
...
@@ -766,6 +777,19 @@ int MSVCRT_vsnwprintf( MSVCRT_wchar_t *str, unsigned int len,
}
/*********************************************************************
* _snwprintf (MSVCRT.@)
*/
int
MSVCRT__snwprintf
(
MSVCRT_wchar_t
*
str
,
unsigned
int
len
,
const
MSVCRT_wchar_t
*
format
,
...)
{
int
retval
;
va_list
valist
;
va_start
(
valist
,
format
);
retval
=
MSVCRT_vsnwprintf
(
str
,
len
,
format
,
valist
);
va_end
(
valist
);
return
retval
;
}
/*********************************************************************
* sprintf (MSVCRT.@)
*/
int
MSVCRT_sprintf
(
char
*
str
,
const
char
*
format
,
...
)
...
...
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