From f14f46368760cf2cfde7a85e0ed0d16dc8fcf18b Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Mon, 26 Sep 2016 16:05:55 -0400 Subject: [PATCH] fixed_string.hpp: Don't use skip() as not all stream types support it --- include/fc/fixed_string.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/fc/fixed_string.hpp b/include/fc/fixed_string.hpp index 4982838..ca6ea1f 100644 --- a/include/fc/fixed_string.hpp +++ b/include/fc/fixed_string.hpp @@ -111,7 +111,14 @@ namespace fc { if( size.value > 0 ) { if( size.value > sizeof(Storage) ) { s.read( (char*)&u.data, sizeof(Storage) ); - s.skip( size.value - sizeof(Storage) ); + char buf[1024]; + size_t left = size.value - sizeof(Storage); + while( left >= 1024 ) + { + s.read( buf, 1024 ); + left -= 1024; + } + s.read( buf, left ); /* s.seekp( s.tellp() + (size.value - sizeof(Storage)) );