From: Thiago Farina Date: Fri, 26 Feb 2016 22:47:21 +0000 (-0300) Subject: add dns_toupper() helper function X-Git-Tag: rec-4.0.0-alpha2~43^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3465%2Fhead;p=thirdparty%2Fpdns.git 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 --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 8d788dcdf4..d9e6f9f8c4 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; }