diff options
| author | Zach Hilman <zachhilman@gmail.com> | 2018-07-29 19:00:09 -0400 |
|---|---|---|
| committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-01 00:16:54 -0400 |
| commit | 568ce6304c9a7def1ee0cd9cc65f0428d5d9a5c5 (patch) | |
| tree | cae04a5eefd883d1a665d9502370ec5ff9faa3fd /src/core/crypto/ctr_encryption_layer.cpp | |
| parent | feb6b2b4a82acb41248701ef69aa6758408927d0 (diff) | |
Add missing includes and use const where applicable
Diffstat (limited to 'src/core/crypto/ctr_encryption_layer.cpp')
| -rw-r--r-- | src/core/crypto/ctr_encryption_layer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/crypto/ctr_encryption_layer.cpp b/src/core/crypto/ctr_encryption_layer.cpp index 5dbc257e5e..106db02b39 100644 --- a/src/core/crypto/ctr_encryption_layer.cpp +++ b/src/core/crypto/ctr_encryption_layer.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include <string.h> +#include <cstring> #include "common/assert.h" #include "core/crypto/ctr_encryption_layer.h" @@ -33,11 +33,10 @@ size_t CTREncryptionLayer::Read(u8* data, size_t length, size_t offset) const { size_t read = 0x10 - sector_offset; if (length + sector_offset < 0x10) { - memcpy(data, block.data() + sector_offset, std::min<u64>(length, read)); + std::memcpy(data, block.data() + sector_offset, std::min<u64>(length, read)); return read; } - - memcpy(data, block.data() + sector_offset, read); + std::memcpy(data, block.data() + sector_offset, read); return read + Read(data + read, length - read, offset + read); } |
