diff options
author | Peter Powell <petpow@saberuk.com> | 2016-05-07 23:07:55 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2016-09-09 12:06:57 +0100 |
commit | 51014dffc9ec51c4a4f3d2887c03404dbaa793bc (patch) | |
tree | 0501d5a153829744264645e073a60d850a102321 /src/modules/m_cloaking.cpp | |
parent | 02b32f624c0037614c0041cfbc4bbda0299024cf (diff) |
Replace snprintf usage with InspIRCd::Format.
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r-- | src/modules/m_cloaking.cpp | 8 |
1 files changed, 3 insertions, 5 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; } |