summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 1245656f0..cd7516b76 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -773,7 +773,7 @@ void Anope::Unhex(const Anope::string &src, char *dest, size_t sz)
Anope::string d;
Anope::Unhex(src, d);
- strncpy(dest, d.c_str(), sz);
+ memcpy(dest, d.c_str(), std::min(d.length() + 1, sz));
}
int Anope::LastErrorCode()