use climits for MAX_ULONG

check if received ip from api has at least a :
This commit is contained in:
2020-05-05 19:11:47 +02:00
parent 2353e4b420
commit a3c8fe44dd
2 changed files with 6 additions and 2 deletions

View File

@ -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;