summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/configreader.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 5e7ef67ca..bdc84de0b 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -723,9 +723,8 @@ void ServerConfig::Read(bool bail, userrec* user)
case DT_CHARPTR:
{
ValueContainerChar* vcc = (ValueContainerChar*)Values[Index].val;
- /* We do this so that an empty string can still be copied */
- size_t length = strlen(vi.GetString());
- vcc->Set(vi.GetString(), length ? length : 1);
+ /* Make sure we also copy the null terminator */
+ vcc->Set(vi.GetString(), strlen(vi.GetString()) + 1);
}
break;
case DT_INTEGER: