openbsd-ports/games/ivan/patches/patch-FeLib_Include_festring_h
ajacoutot 29692c1c01 Import ivan-0.50.
Iter Vehemens ad Necem (IVAN) is a graphical roguelike game.
It features advanced bodypart and material handling, multi-colored
lighting and, above all, deep gameplay.


- thanks to Martynas Venckus <martynas at altroot dot org> and steven@ for
their patches to make this work under amd64.
- note that this game does not work under sparc64.

"looks reasonable" steven@
2007-02-04 18:56:38 +00:00

31 lines
1020 B
Plaintext

$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));
}
}