$OpenBSD: patch-FeLib_Include_festring_h,v 1.1.1.1 2007/02/04 18:56:38 ajacoutot Exp $ --- FeLib/Include/festring.h.orig Tue Oct 26 21:35:44 2004 +++ FeLib/Include/festring.h Thu Jan 11 15:53:34 2007 @@ -142,7 +142,7 @@ inline festring::festring(const festring inline festring::festring(sizetype N) : Size(N), OwnsData(true), Reserved(N|FESTRING_PAGE) { - char* Ptr = 4 + new char[Reserved + 5]; + char* Ptr = sizeof(ulong) + new char[Reserved + sizeof(ulong) + 1]; REFS(Ptr) = 0; Data = Ptr; } @@ -150,7 +150,7 @@ inline festring::festring(sizetype N) inline festring::festring(sizetype N, char C) : Size(N), OwnsData(true), Reserved(N|FESTRING_PAGE) { - char* Ptr = 4 + new char[Reserved + 5]; + char* Ptr = sizeof(ulong) + new char[Reserved + sizeof(ulong) + 1]; REFS(Ptr) = 0; Data = Ptr; memset(Ptr, C, N); @@ -163,7 +163,7 @@ inline festring::~festring() char* Ptr = Data; if(Ptr && !REFS(Ptr)--) - delete [] &REFS(Ptr); + delete [] (Ptr - sizeof(ulong)); } }