From af9dd4af02f2cfec3e5d71f310e310f41560ee0b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 19 Apr 2010 16:37:26 -0400 Subject: [PATCH] Fix two compile-blockers in tor_vasprintf(). 1) mingw doesn't have _vscprintf(); mingw instead has a working snprintf. 2) windows compilers that _do_ have a working _vscprintf spell it so; they do not spell it _vcsprintf(). --- changes/fix_vscprintf_compile | 3 +++ src/common/compat.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changes/fix_vscprintf_compile diff --git a/changes/fix_vscprintf_compile b/changes/fix_vscprintf_compile new file mode 100644 index 0000000000..47c486b483 --- /dev/null +++ b/changes/fix_vscprintf_compile @@ -0,0 +1,3 @@ + o Major bugfixes: + - Fix two typos in tor_vasprintf() that prevented compilation in + Windows. \ No newline at end of file diff --git a/src/common/compat.c b/src/common/compat.c index 26038c1099..0fb169b734 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -355,12 +355,12 @@ tor_vasprintf(char **strp, const char *fmt, va_list args) else *strp = strp_tmp; return r; -#elif defined(MS_WINDOWS) +#elif defined(_MSC_VER) /* On Windows, _vsnprintf won't tell us the length of the string if it * overflows, so we need to use _vcsprintf to tell how much to allocate */ int len, r; char *res; - len = _vcsprintf(fmt, args); + len = _vscprintf(fmt, args); if (len < 0) { *strp = NULL; return -1; -- 2.11.4.GIT