> + int rv = -1;
> + size_t n;
> + size_t old_pos;
> + size_t old_size;
> + va_list ap_copy;
> + char c;
> +
> + old_pos = mio->impl.mem.pos;
> + old_size = mio->impl.mem.size;
> + va_copy (ap_copy, ap);
> + /* compute the size we will need into the buffer */
> + n = vsnprintf (&c, 1, format, ap_copy);
> + va_end (ap_copy);
> + if (mem_try_ensure_space (mio, n))
> + {
> + unsigned char c;
Just noticed https://github.com/universal-ctags/ctags/issues/1044 which is
definitely a better thing to do.
A sidenote about finding more users of MIO - it could be mentioned in the
following stackoverflow topics:
http://stackoverflow.com/questions/539537/memory-buffer-as-file
http://stackoverflow.com/questions/5135854/make-a-file-pointer-read-write-to-an-in-memory-location
http://stackoverflow.com/questions/9591196/send-file-writes-to-in-memory-buffer-fopen-something-but-write-to-buffer-not
I believe users with systems without open_memstream() would find it useful.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1070/files/f95656cbe818d69bb4432d14b978ec83764872b2#r71956403