]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix an instance of snprintf; don't use _snprintf directly
authorNick Mathewson <nickm@torproject.org>
Wed, 19 Dec 2012 21:51:53 +0000 (16:51 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 17 Jan 2013 03:29:39 +0000 (22:29 -0500)
changes/7304 [new file with mode: 0644]
src/common/compat.h
src/or/or.h
src/or/routerparse.c

diff --git a/changes/7304 b/changes/7304
new file mode 100644 (file)
index 0000000..bfb797b
--- /dev/null
@@ -0,0 +1,7 @@
+  o Minor bugfixes:
+    - Replace all calls to snprintf outside of src/ext with tor_snprintf.
+      Fix for bug 7304.
+  o Code simplification and refactoring:
+    - Remove the #define to replace snprintf with _snprintf on windows;
+      they have different semantics, and all of our callers should be
+      using tor_snprintf anyway. Partial fix for bug 7304.
index 86ea0c41d40dce5de37b91a46701a4178cd38dc2..630682e63848670a5709de2955a214d256db64d7 100644 (file)
@@ -59,7 +59,6 @@
 #include <io.h>
 #include <math.h>
 #include <projects.h>
-#define snprintf _snprintf
 /* this is not exported as W .... */
 #define SHGetPathFromIDListW SHGetPathFromIDList
 /* wcecompat has vasprintf */
index 459e18e46690b93a5c1d65efce3e32af313d449d..6ec7c3a79caff7120b2d7c7c3bcedcb062b985c2 100644 (file)
@@ -81,7 +81,6 @@
 #include <process.h>
 #include <direct.h>
 #include <windows.h>
-#define snprintf _snprintf
 #endif
 
 #ifdef USE_BUFFEREVENTS
index 1aee4e533258fa1f03c3c6aa287f28bee93d07ff..48744d6994d6a27520ee13649128c20996ec32d2 100644 (file)
@@ -3828,7 +3828,7 @@ get_next_token(memarea_t *area,
   if ((size_t)(eol-next) != 9+obname_len+5 ||
       strcmp_len(next+9, tok->object_type, obname_len) ||
       strcmp_len(eol-5, "-----", 5)) {
-    snprintf(ebuf, sizeof(ebuf), "Malformed object: mismatched end tag %s",
+    tor_snprintf(ebuf, sizeof(ebuf), "Malformed object: mismatched end tag %s",
              tok->object_type);
     ebuf[sizeof(ebuf)-1] = '\0';
     RET_ERR(ebuf);