From 95eb4e8e84c97db5f1bee2e1e20254cd6f00e5c1 Mon Sep 17 00:00:00 2001
From: Shon Ferguson <shonferg@users.sourceforge.net>
Date: Sat, 24 Jun 2006 03:51:55 +0000
Subject: [PATCH] Fixed an error in SmallString NifStream function.

---
 NIF_IO.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/NIF_IO.cpp b/NIF_IO.cpp
index f398c993..b4bc0a3d 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()) );
+	byte len = byte( std::streamsize(val.str.size()) + 1 );
 	WriteByte( len, out );
-	out.write( val.str.c_str(), std::streamsize(val.str.size()) );
+	out.write( val.str.c_str(), std::streamsize(val.str.size()) + 1 );
 };
 
 ostream & operator<<( ostream & out, ShortString const & val ) {
-- 
GitLab