[vlc-devel] [PATCH] Add open_memstream replacement

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed Aug 24 18:43:03 CEST 2016


On 8/24/2016 2:57 PM, Felix Paul K├╝hne wrote:
> ---
>  compat/open_memstream.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++
>  configure.ac            |   2 +-
>  include/vlc_fixups.h    |   5 ++
>  3 files changed, 159 insertions(+), 1 deletion(-)
>  create mode 100644 compat/open_memstream.c

>From IRC. I figured it was relevant to archive here.

[17:31] < j-b> why can't we have uri_compose without open_memstream?
[17:31] < Daemon404> i would have thought android would have fopencookie
[17:31] < Daemon404> j-b, ... you can
[17:31] < Daemon404> i was arguing this earlier.
[17:34] < Daemon404> use snprintf, check its return value, realloc if needed, continue.
[17:38] < Daemon404> (also, fyi, the current open_memstream based impl will fail hard if there is an alloc failure, since all the writes to the buffer are unchecked)

This also lets it work on Windows.

- Derek


More information about the vlc-devel mailing list