From 32c38349483dbe7f0fdd83aa77215aac381b219d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 13 May 2019 18:58:00 +0000 Subject: [PATCH] storages: fix writing varints on big endian --- contrib/epee/include/storages/portable_storage_to_bin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/epee/include/storages/portable_storage_to_bin.h b/contrib/epee/include/storages/portable_storage_to_bin.h index 9501bbc2a..de191c236 100644 --- a/contrib/epee/include/storages/portable_storage_to_bin.h +++ b/contrib/epee/include/storages/portable_storage_to_bin.h @@ -40,7 +40,7 @@ namespace epee template size_t pack_varint_t(t_stream& strm, uint8_t type_or, size_t& pv) { - pack_value v = (*((pack_value*)&pv)) << 2; + pack_value v = pv << 2; v |= type_or; strm.write((const char*)&v, sizeof(pack_value)); return sizeof(pack_value);