Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
663c21d4
Commit
663c21d4
authored
Sep 14, 2012
by
Ronald S. Bultje
Committed by
Derek Buitenhuis
Sep 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compat/vsnprintf: return number of bytes required on truncation.
This conforms to C99, but requires Windows >= XP.
parent
e1b44960
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
snprintf.c
compat/msvcrt/snprintf.c
+6
-3
No files found.
compat/msvcrt/snprintf.c
View file @
663c21d4
...
...
@@ -43,9 +43,10 @@ int avpriv_vsnprintf(char *s, size_t n, const char *fmt,
va_list
ap
)
{
int
ret
;
va_list
ap_copy
;
if
(
n
==
0
)
return
0
;
return
_vscprintf
(
fmt
,
ap
)
;
else
if
(
n
>
INT_MAX
)
return
AVERROR
(
EOVERFLOW
);
...
...
@@ -56,9 +57,11 @@ int avpriv_vsnprintf(char *s, size_t n, const char *fmt,
* _snprintf/_vsnprintf() to workaround this problem.
* See http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */
memset
(
s
,
0
,
n
);
ret
=
_vsnprintf
(
s
,
n
-
1
,
fmt
,
ap
);
va_copy
(
ap_copy
,
ap
);
ret
=
_vsnprintf
(
s
,
n
-
1
,
fmt
,
ap_copy
);
va_end
(
ap_copy
);
if
(
ret
==
-
1
)
ret
=
n
;
ret
=
_vscprintf
(
fmt
,
ap
)
;
return
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