summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-25 16:11:19 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-25 16:11:19 -0700
commit2a9409f587eec1acd7a98cbd5dacc31ac3525812 (patch)
treec791ea8465e2af2a32bd6c98745d72ca0588d08a /src/buffer.c
parentb018c01fad3b0c6dd9c180b3ba804baee326d9dd (diff)
Removed cmark_strbuf_printf and cmark_strbuf_vprintf.
These are no longer needed, and cause complications for MSVC. Also removed HAVE_VA_COPY and HAVE_C99_SNPRINTF feature tests.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/buffer.c b/src/buffer.c
index e07fba6..509eb6c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -165,54 +165,6 @@ void cmark_strbuf_puts(cmark_strbuf *buf, const char *string)
cmark_strbuf_safe_strlen(string));
}
-void cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap)
-{
- size_t expected_size = strlen(format);
- if (expected_size <= SIZE_MAX / 2)
- expected_size *= 2;
- S_strbuf_grow_by(buf, expected_size);
-
- while (1) {
- va_list args;
- va_copy(args, ap);
-
- int len = vsnprintf(
- (char *)buf->ptr + buf->size,
- buf->asize - buf->size,
- format, args
- );
-#ifndef HAVE_C99_SNPRINTF
- // Assume we're on Windows.
- if (len < 0) {
- len = _vscprintf(format, args);
- }
-#endif
-
- va_end(args);
-
- if (len < 0) {
- perror("vsnprintf in cmark_strbuf_vprintf");
- abort();
- }
-
- if ((size_t)len < (size_t)(buf->asize - buf->size)) {
- buf->size += len;
- break;
- }
-
- S_strbuf_grow_by(buf, len);
- }
-}
-
-void cmark_strbuf_printf(cmark_strbuf *buf, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- cmark_strbuf_vprintf(buf, format, ap);
- va_end(ap);
-}
-
void cmark_strbuf_copy_cstr(char *data, bufsize_t datasize, const cmark_strbuf *buf)
{
bufsize_t copylen;