summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-09-16 10:53:19 +0200
committerGitHub <noreply@github.com>2016-09-16 10:53:19 +0200
commit926361d233f4e6ea6a3964a070097fe637bd6bed (patch)
tree91b9eb18bd21be6c7d8e10a2bedbcb0d6930bd40 /src/modules
parent42888e2907dacb829e2a29effbee83efb5bef6ec (diff)
parent51014dffc9ec51c4a4f3d2887c03404dbaa793bc (diff)
Merge pull request #1176 from SaberUK/master+format
Replace snprintf usage with InspIRCd::Format.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cloaking.cpp8
-rw-r--r--src/modules/m_spanningtree/override_map.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 1534043ce..890c799f2 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -253,19 +253,17 @@ class ModuleCloaking : public Module
}
else
{
- char buf[50];
if (ip.sa.sa_family == AF_INET6)
{
- snprintf(buf, 50, ".%02x%02x.%02x%02x%s",
+ rv.append(InspIRCd::Format(".%02x%02x.%02x%02x%s",
ip.in6.sin6_addr.s6_addr[2], ip.in6.sin6_addr.s6_addr[3],
- ip.in6.sin6_addr.s6_addr[0], ip.in6.sin6_addr.s6_addr[1], suffix.c_str());
+ ip.in6.sin6_addr.s6_addr[0], ip.in6.sin6_addr.s6_addr[1], suffix.c_str()));
}
else
{
const unsigned char* ip4 = (const unsigned char*)&ip.in4.sin_addr;
- snprintf(buf, 50, ".%d.%d%s", ip4[1], ip4[0], suffix.c_str());
+ rv.append(InspIRCd::Format(".%d.%d%s", ip4[1], ip4[0], suffix.c_str()));
}
- rv.append(buf);
}
return rv;
}
diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp
index 660d738e9..a22fa48ac 100644
--- a/src/modules/m_spanningtree/override_map.cpp
+++ b/src/modules/m_spanningtree/override_map.cpp
@@ -82,9 +82,7 @@ static std::vector<std::string> GetMap(User* user, TreeServer* current, unsigned
// Pad with spaces until its at max len, max_len must always be >= my names length
buffer.append(max_len - current->GetName().length(), ' ');
- char buf[16];
- snprintf(buf, sizeof(buf), "%5d [%5.2f%%]", current->UserCount, percent);
- buffer += buf;
+ buffer += InspIRCd::Format("%5d [%5.2f%%]", current->UserCount, percent);
if (user->IsOper())
{