]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/convto.h
Don't kill cloaking users when hash/md5 is missing.
[user/henk/code/inspircd.git] / include / convto.h
index 2f808d1fb3a722128a8047f8e6ca1973016a8fcf..9bad62b93d0894782aaa02a649c020a9e234173c 100644 (file)
@@ -1,8 +1,9 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
- *   Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
+ *   Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -104,14 +105,14 @@ template<> inline char ConvToNum<char>(const std::string& in)
 {
        // We specialise ConvToNum for char to avoid istringstream treating
        // the input as a character literal.
-       uint16_t num = ConvToNum<uint16_t>(in);
-       return num <= UINT8_MAX ? num : 0;
+       int16_t num = ConvToNum<int16_t>(in);
+       return num >= INT8_MIN && num <= INT8_MAX ? num : 0;
 }
 
 template<> inline unsigned char ConvToNum<unsigned char>(const std::string& in)
 {
        // We specialise ConvToNum for unsigned char to avoid istringstream
        // treating the input as a character literal.
-       int16_t num = ConvToNum<int16_t>(in);
-       return num >= INT8_MIN && num <= INT8_MAX ? num : 0;
+       uint16_t num = ConvToNum<uint16_t>(in);
+       return num <= UINT8_MAX ? num : 0;
 }