Bläddra i källkod

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().
Nick Mathewson 15 år sedan
förälder
incheckning
af9dd4af02
2 ändrade filer med 5 tillägg och 2 borttagningar
  1. 3 0
      changes/fix_vscprintf_compile
  2. 2 2
      src/common/compat.c

+ 3 - 0
changes/fix_vscprintf_compile

@@ -0,0 +1,3 @@
+  o Major bugfixes:
+    - Fix two typos in tor_vasprintf() that prevented compilation in
+      Windows.

+ 2 - 2
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;