[tor-commits] [tor/maint-0.2.7] Use tor_sscanf, not sscanf, in test_util.c.

nickm at torproject.org nickm at torproject.org
Thu Jun 2 14:12:43 UTC 2016


commit 5854b19816bc7b09df4785afbfb0e8891b398638
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Jun 2 10:11:29 2016 -0400

    Use tor_sscanf, not sscanf, in test_util.c.
    
    Fixes the 0.2.7 case of bug #19213, which prevented mingw64 from
    working.
---
 changes/bug19213     | 3 +++
 src/test/test_util.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/bug19213 b/changes/bug19213
new file mode 100644
index 0000000..f912ffb
--- /dev/null
+++ b/changes/bug19213
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation):
+    - Cause the unit tests to compile correctly on mingw64 versions
+      that lack sscanf. Fixes bug 19213. Bugfix on 0.2.7.1-alpha.
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 0a5783e..046e92e 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -4377,7 +4377,7 @@ test_util_writepid(void *arg)
   contents = read_file_to_str(fname, 0, NULL);
   tt_assert(contents);
 
-  int n = sscanf(contents, "%lu\n%c", &pid, &c);
+  int n = tor_sscanf(contents, "%lu\n%c", &pid, &c);
   tt_int_op(n, OP_EQ, 1);
 
 #ifdef _WIN32



More information about the tor-commits mailing list