diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-05-31 13:34:17 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-05-31 13:34:17 +0200 |
commit | 9dd842c540146839688bca33bfd386b925efff2c (patch) | |
tree | 2449a01cc37c2368f1d3f95e4ff3dd5d82c99172 /src/buffer.c | |
parent | 4be7a417b4ea18f36e294a547c304a454a53a98f (diff) | |
parent | 0ddadad7333a999ab3289fd6d47433e4984d182e (diff) |
Merge pull request #45 from nwellnhof/windows_snprintf
Cope with broken snprintf on Windows
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index 5ec8b49..2b7f062 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -175,6 +175,12 @@ int cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap) 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); |