From 315f45a0454086f0e2cd3d9d84a5f2cdbc4c8495 Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Fri, 26 Feb 2016 19:47:21 -0300 Subject: [PATCH] add dns_toupper() helper function This patch adds a ASCII version of toupper() function, called dns_toupper(), and use it in place of toupper(). This fixes issue #3425 --- pdns/misc.hh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdns/misc.hh b/pdns/misc.hh index 8d788dcdf..d9e6f9f8c 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -244,6 +244,13 @@ inline char dns_tolower(char c) return c; } +inline char dns_toupper(char c) +{ + if(c>='a' && c<='z') + c+='A'-'a'; + return c; +} + inline const string toLower(const string &upper) { string reply(upper); @@ -281,7 +288,7 @@ inline string toUpper( const string& s ) { string r(s); for( unsigned int i = 0; i < s.length(); i++ ) { - r[i] = toupper( r[i] ); + r[i] = dns_toupper(r[i]); } return r; } -- 2.40.0