From 39f2fa9ccf916b6afc084bee6d872214a8a70323 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 6 Apr 2007 13:07:55 +0000 Subject: Fix the previous commit better - always copy the null terminator (oops) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6744 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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: -- cgit v1.2.3