3398fe88f4
both gcc3 and 4 agree
31 lines
1018 B
Plaintext
31 lines
1018 B
Plaintext
$OpenBSD: patch-FeLib_Include_festring_h,v 1.2 2010/05/23 15:58:02 espie Exp $
|
|
--- FeLib/Include/festring.h.orig Tue Oct 26 21:35:44 2004
|
|
+++ FeLib/Include/festring.h Sat May 22 07:28:38 2010
|
|
@@ -142,7 +142,7 @@ inline festring::festring(const festring& Str)
|
|
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));
|
|
}
|
|
}
|
|
|