]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix two compile-blockers in tor_vasprintf().
authorNick Mathewson <nickm@torproject.org>
Mon, 19 Apr 2010 20:37:26 +0000 (16:37 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 19 Apr 2010 20:37:26 +0000 (16:37 -0400)
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 [new file with mode: 0644]
src/common/compat.c

diff --git a/changes/fix_vscprintf_compile b/changes/fix_vscprintf_compile
new file mode 100644 (file)
index 0000000..47c486b
--- /dev/null
@@ -0,0 +1,3 @@
+  o Major bugfixes:
+    - Fix two typos in tor_vasprintf() that prevented compilation in
+      Windows.
\ No newline at end of file
index 26038c1099a407d9d640a0960c8d2e6b5b633a0d..0fb169b7347793b016027652091473c7f5cf7317 100644 (file)
@@ -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;