aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-12 12:40:51 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-12-12 12:40:51 +0100
commit786402365e9c819235636d9300bd25c362a29db7 (patch)
tree9c0d0dec6886b404b729414830d3a759e7f019c1 /src
parentf3d1e92856fbed53ebaad40f94180bd1ba60ffec (diff)
Cleanup
Diffstat (limited to 'src')
-rw-r--r--src/libutil/util.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 2f869d909..9b149de80 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -515,8 +515,9 @@ template<typename T>
T readLittleEndian(unsigned char * p)
{
T x = 0;
- for (size_t i = 0; i < sizeof(x); ++i)
- x |= ((T) *p++) << (i * 8);
+ for (size_t i = 0; i < sizeof(x); ++i, ++p) {
+ x |= ((T) *p) << (i * 8);
+ }
return x;
}