From becf4439490efa1746b9556671149a6f153a740b Mon Sep 17 00:00:00 2001
From: Shon Ferguson <shonferg@users.sourceforge.net>
Date: Sat, 24 Jun 2006 04:01:37 +0000
Subject: [PATCH] Hopefully ShortString is really fixed this time.

---
 NIF_IO.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/NIF_IO.cpp b/NIF_IO.cpp
index b4bc0a3d..9b03afa7 100644
--- a/NIF_IO.cpp
+++ b/NIF_IO.cpp
@@ -281,9 +281,9 @@ void NifStream( ShortString & val, istream& in, uint version ) {
 };
 
 void NifStream( ShortString const & val, ostream& out, uint version ) {
-	byte len = byte( std::streamsize(val.str.size()) + 1 );
-	WriteByte( len, out );
-	out.write( val.str.c_str(), std::streamsize(val.str.size()) + 1 );
+	WriteByte( byte(val.str.size() + 1), out );
+	out.write( val.str.c_str(), std::streamsize(val.str.size()) );
+	WriteByte( 0, out );
 };
 
 ostream & operator<<( ostream & out, ShortString const & val ) {
-- 
GitLab