<p>In <a href="https://github.com/geany/geany/pull/1070#discussion_r71956403">ctags/main/mio.c</a>:</p>
<pre style='color:#555'>> +            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;
</pre>
<p>Just noticed <a href="https://github.com/universal-ctags/ctags/issues/1044" class="issue-link js-issue-link" data-url="https://github.com/universal-ctags/ctags/issues/1044" data-id="167144044" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">universal-ctags/ctags#1044</a> which is definitely a better thing to do.</p>

<p>A sidenote about finding more users of MIO - it could be mentioned in the following stackoverflow topics:</p>

<p><a href="http://stackoverflow.com/questions/539537/memory-buffer-as-file">http://stackoverflow.com/questions/539537/memory-buffer-as-file</a><br>
<a href="http://stackoverflow.com/questions/5135854/make-a-file-pointer-read-write-to-an-in-memory-location">http://stackoverflow.com/questions/5135854/make-a-file-pointer-read-write-to-an-in-memory-location</a><br>
<a href="http://stackoverflow.com/questions/9591196/send-file-writes-to-in-memory-buffer-fopen-something-but-write-to-buffer-not">http://stackoverflow.com/questions/9591196/send-file-writes-to-in-memory-buffer-fopen-something-but-write-to-buffer-not</a></p>

<p>I believe users with systems without open_memstream() would find it useful.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1070/files/f95656cbe818d69bb4432d14b978ec83764872b2#r71956403">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJyDUwobfrE1gKxM-WoSwA0TSmBsqks5qYUisgaJpZM4IzlZ-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ_reOOymS3yi-lXABFALAjOZ5GHXks5qYUisgaJpZM4IzlZ-.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1070/files/f95656cbe818d69bb4432d14b978ec83764872b2#r71956403"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>