Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Strogin
flac
Commits
e0f638fa
Commit
e0f638fa
authored
Aug 09, 2014
by
Erik de Castro Lopo
Browse files
win_utf8_io.c : Use vsnprintf_s instead of vsprintf.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
parent
01d1aa7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/share/win_utf8_io/win_utf8_io.c
View file @
e0f638fa
...
...
@@ -177,7 +177,7 @@ int printf_utf8(const char *format, ...)
va_list
argptr
;
if
(
!
(
utmp
=
(
char
*
)
malloc
(
32768
*
sizeof
(
char
))))
break
;
va_start
(
argptr
,
format
);
ret
=
vsprintf
(
utmp
,
format
,
argptr
);
ret
=
vs
n
printf
_s
(
utmp
,
32768
,
_TRUNCATE
,
format
,
argptr
);
va_end
(
argptr
);
if
(
ret
<
0
)
break
;
if
(
!
(
wout
=
wchar_from_utf8
(
utmp
)))
{
...
...
@@ -203,7 +203,7 @@ int fprintf_utf8(FILE *stream, const char *format, ...)
va_list
argptr
;
if
(
!
(
utmp
=
(
char
*
)
malloc
(
32768
*
sizeof
(
char
))))
break
;
va_start
(
argptr
,
format
);
ret
=
vsprintf
(
utmp
,
format
,
argptr
);
ret
=
vs
n
printf
_s
(
utmp
,
32768
,
_TRUNCATE
,
format
,
argptr
);
va_end
(
argptr
);
if
(
ret
<
0
)
break
;
if
(
!
(
wout
=
wchar_from_utf8
(
utmp
)))
{
...
...
@@ -227,7 +227,7 @@ int vfprintf_utf8(FILE *stream, const char *format, va_list argptr)
while
(
1
)
{
if
(
!
(
utmp
=
(
char
*
)
malloc
(
32768
*
sizeof
(
char
))))
break
;
if
((
ret
=
vsprintf
(
utmp
,
format
,
argptr
))
<
0
)
break
;
if
((
ret
=
vs
n
printf
_s
(
utmp
,
32768
,
_TRUNCATE
,
format
,
argptr
))
<
0
)
break
;
if
(
!
(
wout
=
wchar_from_utf8
(
utmp
)))
{
ret
=
-
1
;
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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