sources/network/bytestream.cpp

branch
protocol5
changeset 84
3bd32eec3d57
parent 83
08bfc3d9d2ae
child 88
08ccaf26cffd
--- a/sources/network/bytestream.cpp	Sun May 17 22:07:48 2015 +0300
+++ b/sources/network/bytestream.cpp	Wed May 27 21:15:52 2015 +0300
@@ -129,8 +129,12 @@
 {
 	if (bytes_left() < bytes)
 	{
-		throw IOError (format ("attempted to read %1 byte(s) past the end of bytestream",
-			bytes - bytes_left()));
+		int bytesPast = bytes - bytes_left();
+
+		String message;
+		message.sprintf ("attempted to read %d byte%s past the end of bytestream",
+			bytesPast, bytesPast != -1 ? "s" : "");
+		throw IOError (message);
 	}
 }
 

mercurial