aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-04-05 23:22:28 -0400
committerNick Mathewson <nickm@torproject.org>2016-04-05 23:22:28 -0400
commitd7a0382ba337bd1cbd7568a607d85e303012b22c (patch)
treee373ed0ee21e3d9c8030ae172f79ea0ae553cf63 /src/test/test_util.c
parentd037369e562ec40e602a86919c3e8341c867b48b (diff)
downloadtor-d7a0382ba337bd1cbd7568a607d85e303012b22c.tar.gz
tor-d7a0382ba337bd1cbd7568a607d85e303012b22c.zip
Don't call the system toupper or tolower.
Yes, we could cast to unsigned char first, but it's probably safest to just use our own (in test_util), or remove bad-idea features that we don't use (in readpassphrase.c). Fixes 18728.
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r--src/test/test_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 7d43b8156b..21ff75741a 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2297,7 +2297,8 @@ test_util_sscanf(void *arg)
}
#define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")
-#define tt_ci_char_op(a,op,b) tt_char_op(tolower(a),op,tolower(b))
+#define tt_ci_char_op(a,op,b) \
+ tt_char_op(TOR_TOLOWER((int)a),op,TOR_TOLOWER((int)b))
#ifndef HAVE_STRNLEN
static size_t