sources/network/bytestream.cpp

changeset 83
08bfc3d9d2ae
parent 73
07dda51a7a8e
child 88
08ccaf26cffd
--- a/sources/network/bytestream.cpp	Tue May 26 18:19:27 2015 +0300
+++ b/sources/network/bytestream.cpp	Tue May 26 18:46:24 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