this means memcpy just returns immediately. Now if the string value is 0 in length we copy one byte instead (which just copies the null terminator)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6743
e03df62e-2008-0410-955e-
edbf42e46eb7
case DT_CHARPTR:
{
ValueContainerChar* vcc = (ValueContainerChar*)Values[Index].val;
- vcc->Set(vi.GetString(), strlen(vi.GetString()));
+ /* 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);
}
break;
case DT_INTEGER: