From 9d1d3a454e95098bebe1807f4d05f9378bfc0f81 Mon Sep 17 00:00:00 2001 From: kenshi84 Date: Fri, 6 Jan 2017 08:37:15 +0900 Subject: portable serializer: use signed char for size --- external/boost/archive/portable_binary_archive.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'external/boost/archive/portable_binary_archive.hpp') diff --git a/external/boost/archive/portable_binary_archive.hpp b/external/boost/archive/portable_binary_archive.hpp index 560ef121b..e940c5b9e 100644 --- a/external/boost/archive/portable_binary_archive.hpp +++ b/external/boost/archive/portable_binary_archive.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #if CHAR_BIT != 8 @@ -37,7 +38,9 @@ enum portable_binary_archive_flags { //#endif inline void -reverse_bytes(char size, char *address){ +reverse_bytes(signed char size, char *address){ + if (size <= 0) + throw archive_exception(archive_exception::other_exception); char * first = address; char * last = first + size - 1; for(;first < last;++first, --last){ -- cgit v1.2.3