use climits for MAX_ULONG
check if received ip from api has at least a :
This commit is contained in:
		@@ -3,8 +3,9 @@
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#include "api/TelegramAPI.h"
 | 
			
		||||
#include "Logger.h"
 | 
			
		||||
 | 
			
		||||
#include <Logger.h>
 | 
			
		||||
#include <climits>
 | 
			
		||||
 | 
			
		||||
int TelegramAPI::sendMessage(const std::string& text) {
 | 
			
		||||
    Hashmap<std::string, std::string> args;
 | 
			
		||||
@@ -15,7 +16,6 @@ int TelegramAPI::sendMessage(const std::string& text) {
 | 
			
		||||
 | 
			
		||||
    std::string reply = request("https://api.telegram.org/bot" + apikey + "/sendmessage", false, args, headers);
 | 
			
		||||
 | 
			
		||||
    unsigned const long ULONG_MAX = -1;
 | 
			
		||||
    if (reply.find("\"error_code\"") != ULONG_MAX) {
 | 
			
		||||
        Logger::error("failed to refresh the ip (Dynu API)");
 | 
			
		||||
        return -1;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user