From f083795c79fc062951d0253b4babf7e3b48c6ccb Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 8 Jan 2024 13:06:23 +0000 Subject: [PATCH] Fix various format string issues. --- include/language.h | 4 ++-- modules/commands/cs_enforce.cpp | 2 +- modules/commands/cs_set.cpp | 8 ++++---- modules/commands/hs_request.cpp | 2 +- modules/commands/ms_del.cpp | 2 +- modules/commands/ms_info.cpp | 26 ++++++++++++++------------ modules/commands/ms_rsend.cpp | 2 +- modules/commands/ms_send.cpp | 2 +- modules/commands/ns_group.cpp | 4 ++-- modules/commands/ns_register.cpp | 8 ++++++-- modules/commands/os_forbid.cpp | 4 ++-- modules/commands/os_logsearch.cpp | 8 ++++---- modules/commands/os_news.cpp | 5 +++++ modules/commands/os_stats.cpp | 22 +++++++++++----------- modules/commands/os_svs.cpp | 2 +- modules/extra/stats/cs_fantasy_top.cpp | 2 +- modules/protocol/bahamut.cpp | 2 +- modules/protocol/unrealircd.cpp | 2 +- modules/pseudoclients/chanserv.cpp | 6 +++--- modules/pseudoclients/memoserv.cpp | 4 ++-- modules/pseudoclients/nickserv.cpp | 2 +- src/mail.cpp | 2 +- 22 files changed, 66 insertions(+), 55 deletions(-) diff --git a/include/language.h b/include/language.h index 965a546c0..f03f6cb8e 100644 --- a/include/language.h +++ b/include/language.h @@ -111,9 +111,9 @@ namespace Language #define CHAN_INFO_HEADER _("Information for channel \002%s\002:") #define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.") #define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \ - "Type \002%s%s READ %s %d\002 to read it.") + "Type \002%s%s READ %s %zu\002 to read it.") #define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \ - "Type \002%s%s READ %d\002 to read it.") + "Type \002%s%s READ %zu\002 to read it.") #define MEMO_HAVE_NO_MEMOS _("You have no memos.") #define MEMO_X_HAS_NO_MEMOS _("%s has no memos.") #define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.") diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 46bb86a35..d0165013a 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -203,7 +203,7 @@ private: ci->c->Kick(NULL, user, "%s", reason.c_str()); } - source.Reply(_("LIMIT enforced on %s, %d users removed."), ci->name.c_str(), users.size()); + source.Reply(_("LIMIT enforced on %s, %zu users removed."), ci->name.c_str(), users.size()); } public: diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 17183898c..973a01b23 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -122,7 +122,7 @@ public: source.Reply(_("Enables or disables %s's autoop feature for a\n" "channel. When disabled, users who join the channel will\n" "not automatically gain any status from %s."), source.service->nick.c_str(), - source.service->nick.c_str(), this->name.c_str()); + source.service->nick.c_str()); return true; } }; @@ -189,7 +189,7 @@ public: "0: ban in the form *!user@host\n" "1: ban in the form *!*user@host\n" "2: ban in the form *!*@host\n" - "3: ban in the form *!*user@*.domain"), this->name.c_str()); + "3: ban in the form *!*user@*.domain")); return true; } }; @@ -251,7 +251,7 @@ public: this->SendSyntax(source); source.Reply(" "); source.Reply(_("Sets the description for the channel, which shows up with\n" - "the \002LIST\002 and \002INFO\002 commands."), this->name.c_str()); + "the \002LIST\002 and \002INFO\002 commands.")); return true; } }; @@ -320,7 +320,7 @@ public: this->SendSyntax(source); source.Reply(" "); source.Reply(_("Changes the founder of a channel. The new nickname must\n" - "be a registered one."), this->name.c_str()); + "be a registered one.")); return true; } }; diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index f207d6966..8e63f2b9d 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -157,7 +157,7 @@ public: time_t send_delay = Config->GetModule("memoserv")->Get("senddelay"); if (Config->GetModule(this->owner)->Get("memooper") && send_delay > 0 && u && u->lastmemosend + send_delay > Anope::CurTime) { - source.Reply(_("Please wait %d seconds before requesting a new vHost."), send_delay); + source.Reply(_("Please wait %lu seconds before requesting a new vHost."), (unsigned long)send_delay); u->lastmemosend = Anope::CurTime; return; } diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index 40be9d4d3..13f2b53d2 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -98,7 +98,7 @@ public: /* Delete last memo. */ FOREACH_MOD(OnMemoDel, (ci ? ci->name : source.nc->display, mi, mi->GetMemo(mi->memos->size() - 1))); mi->Del(mi->memos->size() - 1); - source.Reply(_("Memo %d has been deleted."), mi->memos->size() + 1); + source.Reply(_("Memo %zu has been deleted."), mi->memos->size() + 1); if (ci) Log(LOG_COMMAND, source, this, ci) << "on LAST memo"; } diff --git a/modules/commands/ms_info.cpp b/modules/commands/ms_info.cpp index 38c99934b..b8b44085b 100644 --- a/modules/commands/ms_info.cpp +++ b/modules/commands/ms_info.cpp @@ -80,18 +80,19 @@ public: } else { - unsigned count = 0, i, end; - for (i = 0, end = mi->memos->size(); i < end; ++i) + size_t count = 0; + for (size_t i = 0; i < mi->memos->size(); ++i) if (mi->GetMemo(i)->unread) ++count; + if (count == mi->memos->size()) - source.Reply(_("%s currently has \002%d\002 memos; all of them are unread."), nname.c_str(), count); + source.Reply(_("%s currently has \002%zu\002 memos; all of them are unread."), nname.c_str(), count); else if (!count) - source.Reply(_("%s currently has \002%d\002 memos."), nname.c_str(), mi->memos->size()); + source.Reply(_("%s currently has \002%zu\002 memos."), nname.c_str(), mi->memos->size()); else if (count == 1) - source.Reply(_("%s currently has \002%d\002 memos, of which \0021\002 is unread."), nname.c_str(), mi->memos->size()); + source.Reply(_("%s currently has \002%zu\002 memos, of which \0021\002 is unread."), nname.c_str(), mi->memos->size()); else - source.Reply(_("%s currently has \002%d\002 memos, of which \002%d\002 are unread."), nname.c_str(), mi->memos->size(), count); + source.Reply(_("%s currently has \002%zu\002 memos, of which \002%zu\002 are unread."), nname.c_str(), mi->memos->size(), count); } if (!mi->memomax) { @@ -137,18 +138,19 @@ public: } else { - unsigned count = 0, i, end; - for (i = 0, end = mi->memos->size(); i < end; ++i) + size_t count = 0; + for (size_t i = 0; i < mi->memos->size(); ++i) if (mi->GetMemo(i)->unread) ++count; + if (count == mi->memos->size()) - source.Reply(_("You currently have \002%d\002 memos; all of them are unread."), count); + source.Reply(_("You currently have \002%zu\002 memos; all of them are unread."), count); else if (!count) - source.Reply(_("You currently have \002%d\002 memos."), mi->memos->size()); + source.Reply(_("You currently have \002%zu\002 memos."), mi->memos->size()); else if (count == 1) - source.Reply(_("You currently have \002%d\002 memos, of which \0021\002 is unread."), mi->memos->size()); + source.Reply(_("You currently have \002%zu\002 memos, of which \0021\002 is unread."), mi->memos->size()); else - source.Reply(_("You currently have \002%d\002 memos, of which \002%d\002 are unread."), mi->memos->size(), count); + source.Reply(_("You currently have \002%zu\002 memos, of which \002%zu\002 are unread."), mi->memos->size(), count); } if (!mi->memomax) diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp index c3be36838..854b4e2be 100644 --- a/modules/commands/ms_rsend.cpp +++ b/modules/commands/ms_rsend.cpp @@ -55,7 +55,7 @@ public: if (result == MemoServService::MEMO_INVALID_TARGET) source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str()); else if (result == MemoServService::MEMO_TOO_FAST) - source.Reply(_("Please wait %d seconds before using the %s command again."), Config->GetModule("memoserv")->Get("senddelay"), source.command.c_str()); + source.Reply(_("Please wait %lu seconds before using the %s command again."), Config->GetModule("memoserv")->Get("senddelay"), source.command.c_str()); else if (result == MemoServService::MEMO_TARGET_FULL) source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str()); else diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index 3000d9891..141cca01f 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -54,7 +54,7 @@ public: else if (result == MemoServService::MEMO_INVALID_TARGET) source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str()); else if (result == MemoServService::MEMO_TOO_FAST) - source.Reply(_("Please wait %d seconds before using the %s command again."), Config->GetModule("memoserv")->Get("senddelay"), source.command.c_str()); + source.Reply(_("Please wait %lu seconds before using the %s command again."), Config->GetModule("memoserv")->Get("senddelay"), source.command.c_str()); else if (result == MemoServService::MEMO_TARGET_FULL) source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str()); } diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index fd735d506..6f45d7f49 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -146,7 +146,7 @@ public: if (!(target = NickAlias::Find(nick))) source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); else if (user && Anope::CurTime < user->lastnickreg + reg_delay) - source.Reply(_("Please wait %d seconds before using the GROUP command again."), (reg_delay + user->lastnickreg) - Anope::CurTime); + source.Reply(_("Please wait %lu seconds before using the GROUP command again."), (unsigned long)(reg_delay + user->lastnickreg) - Anope::CurTime); else if (target->nc->HasExt("NS_SUSPENDED")) { Log(LOG_COMMAND, source, this) << "and tried to group to SUSPENDED nick " << target->nick; @@ -352,7 +352,7 @@ public: for (const auto &reply : replies) source.Reply(reply); - source.Reply(_("%d nickname(s) in the group."), nc->aliases->size()); + source.Reply(_("%zu nickname(s) in the group."), nc->aliases->size()); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 7fdca9d03..a5281b4be 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -152,7 +152,8 @@ public: time_t reg_delay = Config->GetModule("nickserv")->Get("regdelay"); if (u && !u->HasMode("OPER") && nickregdelay && Anope::CurTime - u->timestamp < nickregdelay) { - source.Reply(_("You must have been using this nick for at least %d seconds to register."), nickregdelay); + source.Reply(_("You must have been using this nick for at least %lu seconds to register."), + (unsigned long)nickregdelay); return; } @@ -198,7 +199,10 @@ public: if (Config->GetModule("nickserv")->Get("forceemail", "yes") && email.empty()) this->OnSyntaxError(source, ""); else if (u && Anope::CurTime < u->lastnickreg + reg_delay) - source.Reply(_("Please wait %d seconds before using the REGISTER command again."), (u->lastnickreg + reg_delay) - Anope::CurTime); + { + source.Reply(_("Please wait %lu seconds before using the REGISTER command again."), + (unsigned long)(u->lastnickreg + reg_delay) - Anope::CurTime); + } else if (NickAlias::Find(u_nick) != NULL) source.Reply(NICK_ALREADY_REGISTERED, u_nick.c_str()); else if (pass.equals_ci(u_nick)) diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 41e36aee4..4523e694b 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -356,7 +356,7 @@ public: ListFormatter list(source.GetAccount()); list.AddColumn(_("Mask")).AddColumn(_("Type")).AddColumn(_("Creator")).AddColumn(_("Expires")).AddColumn(_("Reason")); - unsigned shown = 0; + size_t shown = 0; for (auto *forbid : forbids) { if (ftype != FT_SIZE && ftype != forbid->type) @@ -401,7 +401,7 @@ public: if (shown >= forbids.size()) source.Reply(_("End of forbid list.")); else - source.Reply(_("End of forbid list - %d/%d entries shown."), shown, forbids.size()); + source.Reply(_("End of forbid list - %zu/%zu entries shown."), shown, forbids.size()); } } } diff --git a/modules/commands/os_logsearch.cpp b/modules/commands/os_logsearch.cpp index 9293feffa..cec0d0b50 100644 --- a/modules/commands/os_logsearch.cpp +++ b/modules/commands/os_logsearch.cpp @@ -127,7 +127,7 @@ public: fd.close(); } - unsigned int found = matches.size(); + size_t found = matches.size(); if (!found) { source.Reply(_("No matches for \002%s\002 found."), search_string.c_str()); @@ -146,10 +146,10 @@ public: } source.Reply(_("Matches for \002%s\002:"), search_string.c_str()); - unsigned int count = 0; + size_t count = 0; for (const auto &match : matches) - source.Reply("#%d: %s", ++count, match.c_str()); - source.Reply(_("Showed %d/%d matches for \002%s\002."), matches.size(), found, search_string.c_str()); + source.Reply("#%zu: %s", ++count, match.c_str()); + source.Reply(_("Showed %zu/%zu matches for \002%s\002."), matches.size(), found, search_string.c_str()); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index 72435de67..631c7abb5 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -12,6 +12,11 @@ #include "module.h" #include "modules/os_news.h" +// TODO: msgarray breaks the format string checking +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wformat-security" +#endif + /* List of messages for each news type. This simplifies message sending. */ enum diff --git a/modules/commands/os_stats.cpp b/modules/commands/os_stats.cpp index 71a37930a..e7575f288 100644 --- a/modules/commands/os_stats.cpp +++ b/modules/commands/os_stats.cpp @@ -68,7 +68,7 @@ private: if (akills) { /* AKILLs */ - source.Reply(_("Current number of AKILLs: \002%d\002"), akills->GetCount()); + source.Reply(_("Current number of AKILLs: \002%zu\002"), akills->GetCount()); timeout = Config->GetModule("operserv")->Get("autokillexpiry", "30d") + 59; if (timeout >= 172800) source.Reply(_("Default AKILL expiry time: \002%d days\002"), timeout / 86400); @@ -88,7 +88,7 @@ private: if (snlines) { /* SNLINEs */ - source.Reply(_("Current number of SNLINEs: \002%d\002"), snlines->GetCount()); + source.Reply(_("Current number of SNLINEs: \002%zu\002"), snlines->GetCount()); timeout = Config->GetModule("operserv")->Get("snlineexpiry", "30d") + 59; if (timeout >= 172800) source.Reply(_("Default SNLINE expiry time: \002%d days\002"), timeout / 86400); @@ -108,7 +108,7 @@ private: if (sqlines) { /* SQLINEs */ - source.Reply(_("Current number of SQLINEs: \002%d\002"), sqlines->GetCount()); + source.Reply(_("Current number of SQLINEs: \002%zu\002"), sqlines->GetCount()); timeout = Config->GetModule("operserv")->Get("sglineexpiry", "30d") + 59; if (timeout >= 172800) source.Reply(_("Default SQLINE expiry time: \002%d days\002"), timeout / 86400); @@ -137,7 +137,7 @@ private: void DoStatsUptime(CommandSource &source) { time_t uptime = Anope::CurTime - Anope::StartTime; - source.Reply(_("Current users: \002%d\002 (\002%d\002 ops)"), UserListByNick.size(), OperCount); + source.Reply(_("Current users: \002%zu\002 (\002%d\002 ops)"), UserListByNick.size(), OperCount); source.Reply(_("Maximum users: \002%d\002 (%s)"), MaxUserCount, Anope::strftime(MaxUserTime, source.GetAccount()).c_str()); source.Reply(_("Services up %s."), Anope::Duration(uptime, source.GetAccount()).c_str()); @@ -171,30 +171,30 @@ private: size_t entries, buckets, max_chain; GetHashStats(UserListByNick, entries, buckets, max_chain); - source.Reply(_("Users (nick): %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Users (nick): %lu entries, %lu buckets, longest chain is %zu"), entries, buckets, max_chain); if (!UserListByUID.empty()) { GetHashStats(UserListByUID, entries, buckets, max_chain); - source.Reply(_("Users (uid): %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Users (uid): %lu entries, %lu buckets, longest chain is %zu"), entries, buckets, max_chain); } GetHashStats(ChannelList, entries, buckets, max_chain); - source.Reply(_("Channels: %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Channels: %zu entries, %zu buckets, longest chain is %zu"), entries, buckets, max_chain); GetHashStats(*RegisteredChannelList, entries, buckets, max_chain); - source.Reply(_("Registered channels: %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Registered channels: %zu entries, %zu buckets, longest chain is %zu"), entries, buckets, max_chain); GetHashStats(*NickAliasList, entries, buckets, max_chain); - source.Reply(_("Registered nicknames: %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Registered nicknames: %zu entries, %zu buckets, longest chain is %zu"), entries, buckets, max_chain); GetHashStats(*NickCoreList, entries, buckets, max_chain); - source.Reply(_("Registered nick groups: %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Registered nick groups: %zu entries, %zu buckets, longest chain is %zu"), entries, buckets, max_chain); if (session_service) { GetHashStats(session_service->GetSessions(), entries, buckets, max_chain); - source.Reply(_("Sessions: %lu entries, %lu buckets, longest chain is %d"), entries, buckets, max_chain); + source.Reply(_("Sessions: %zu entries, %zu buckets, longest chain is %zu"), entries, buckets, max_chain); } } diff --git a/modules/commands/os_svs.cpp b/modules/commands/os_svs.cpp index b8586be9c..e9ef64bf9 100644 --- a/modules/commands/os_svs.cpp +++ b/modules/commands/os_svs.cpp @@ -36,7 +36,7 @@ public: unsigned nicklen = Config->GetBlock("networkinfo")->Get("nicklen"); if (newnick.length() > nicklen) { - source.Reply(_("Nick \002%s\002 was truncated to %d characters."), newnick.c_str(), nicklen, newnick.c_str()); + source.Reply(_("Nick \002%s\002 was truncated to %u characters."), newnick.c_str(), nicklen); newnick = params[1].substr(0, nicklen); } diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp index 5951fe52f..ee1e5656f 100644 --- a/modules/extra/stats/cs_fantasy_top.cpp +++ b/modules/extra/stats/cs_fantasy_top.cpp @@ -149,7 +149,7 @@ public: source.Reply(_("Top %i of %s"), limit, (is_global ? "Network" : channel.c_str())); for (int i = 0; i < res.Rows(); ++i) { - source.Reply(_("%2lu \002%-16s\002 letters: %s, words: %s, lines: %s, smileys: %s, actions: %s"), + source.Reply(_("%2d \002%-16s\002 letters: %s, words: %s, lines: %s, smileys: %s, actions: %s"), i+1, res.Get(i, "nick").c_str(), res.Get(i, "letters").c_str(), res.Get(i, "words").c_str(), res.Get(i, "line").c_str(), res.Get(i, "smileys").c_str(), res.Get(i, "actions").c_str()); diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index f58a40a16..802069f96 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -281,7 +281,7 @@ public: void SendLogin(User *u, NickAlias *) override { - IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon); + IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %ld", (unsigned long)u->signon); } void SendLogout(User *u) override diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp index 506af9b35..30591761e 100644 --- a/modules/protocol/unrealircd.cpp +++ b/modules/protocol/unrealircd.cpp @@ -351,7 +351,7 @@ private: if (Servers::Capab.count("ESVID") > 0 && !na->nc->HasExt("UNCONFIRMED")) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); else - IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon); + IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %ld", (unsigned long)u->signon); } void SendLogout(User *u) override diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index a644c7d7e..414fb9cc0 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -258,7 +258,7 @@ public: "commands are listed below; to use them, type\n" "\002%s%s \037command\037\002. For more information on a\n" "specific command, type \002%s%s HELP \037command\037\002.\n"), - ChanServ->nick.c_str(), ChanServ->nick.c_str(), Config->StrictPrivmsg.c_str(), ChanServ->nick.c_str(), Config->StrictPrivmsg.c_str(), ChanServ->nick.c_str(), ChanServ->nick.c_str(), source.command.c_str()); + ChanServ->nick.c_str(), ChanServ->nick.c_str(), Config->StrictPrivmsg.c_str(), ChanServ->nick.c_str(), Config->StrictPrivmsg.c_str(), ChanServ->nick.c_str()); return EVENT_CONTINUE; } @@ -269,9 +269,9 @@ public: time_t chanserv_expire = Config->GetModule(this)->Get("expire", "30d"); if (chanserv_expire >= 86400) source.Reply(_(" \n" - "Note that any channel which is not used for %d days\n" + "Note that any channel which is not used for %lu days\n" "(i.e. which no user on the channel's access list enters\n" - "for that period of time) will be automatically dropped."), chanserv_expire / 86400); + "for that period of time) will be automatically dropped."), (unsigned long)chanserv_expire / 86400); if (source.IsServicesOper()) source.Reply(_(" \n" "Services Operators can also, depending on their access drop\n" diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index 4ef8a32be..e3be62c7c 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -187,9 +187,9 @@ public: if (c->ci && !c->ci->memos.memos->empty() && c->ci->AccessFor(u).HasPriv("MEMO")) { if (c->ci->memos.memos->size() == 1) - u->SendMessage(MemoServ, _("There is \002%d\002 memo on channel %s."), c->ci->memos.memos->size(), c->ci->name.c_str()); + u->SendMessage(MemoServ, _("There is \002%zu\002 memo on channel %s."), c->ci->memos.memos->size(), c->ci->name.c_str()); else - u->SendMessage(MemoServ, _("There are \002%d\002 memos on channel %s."), c->ci->memos.memos->size(), c->ci->name.c_str()); + u->SendMessage(MemoServ, _("There are \002%zu\002 memos on channel %s."), c->ci->memos.memos->size(), c->ci->name.c_str()); } } diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 91832f687..e896f9bec 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -488,7 +488,7 @@ public: source.Reply(_(" \n" "Accounts that are not used anymore are subject to\n" "the automatic expiration, i.e. they will be deleted\n" - "after %d days if not used."), nickserv_expire / 86400); + "after %lu days if not used."), (unsigned long)nickserv_expire / 86400); } void OnNickCoreCreate(NickCore *nc) override diff --git a/src/mail.cpp b/src/mail.cpp index e1a86630d..46513eafa 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -86,7 +86,7 @@ bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &su if (!b->Get("usemail") || b->Get("sendfrom").empty()) u->SendMessage(service, _("Services have been configured to not send mail.")); else if (Anope::CurTime - u->lastmail < b->Get("delay")) - u->SendMessage(service, _("Please wait \002%d\002 seconds and retry."), b->Get("delay") - (Anope::CurTime - u->lastmail)); + u->SendMessage(service, _("Please wait \002%lu\002 seconds and retry."), (unsigned long)b->Get("delay") - (Anope::CurTime - u->lastmail)); else if (nc->email.empty()) u->SendMessage(service, _("E-mail for \002%s\002 is invalid."), nc->display.c_str()); else