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