mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-17 23:12:17 +00:00
kvdb: correct condition inversion in kvdb::Archive
This commit is contained in:
parent
a26e157579
commit
206b1a1b57
@ -70,7 +70,7 @@ namespace ams::kvdb {
|
|||||||
Result ArchiveReader::Peek(void *dst, size_t size) {
|
Result ArchiveReader::Peek(void *dst, size_t size) {
|
||||||
/* Bounds check. */
|
/* Bounds check. */
|
||||||
R_UNLESS(this->offset + size <= this->buffer.GetSize(), ResultInvalidKeyValue());
|
R_UNLESS(this->offset + size <= this->buffer.GetSize(), ResultInvalidKeyValue());
|
||||||
R_UNLESS(this->offset + size <= this->offset, ResultInvalidKeyValue());
|
R_UNLESS(this->offset < this->offset + size, ResultInvalidKeyValue());
|
||||||
|
|
||||||
std::memcpy(dst, this->buffer.Get() + this->offset, size);
|
std::memcpy(dst, this->buffer.Get() + this->offset, size);
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
@ -131,7 +131,7 @@ namespace ams::kvdb {
|
|||||||
Result ArchiveWriter::Write(const void *src, size_t size) {
|
Result ArchiveWriter::Write(const void *src, size_t size) {
|
||||||
/* Bounds check. */
|
/* Bounds check. */
|
||||||
R_UNLESS(this->offset + size <= this->buffer.GetSize(), ResultInvalidKeyValue());
|
R_UNLESS(this->offset + size <= this->buffer.GetSize(), ResultInvalidKeyValue());
|
||||||
R_UNLESS(this->offset + size <= this->offset, ResultInvalidKeyValue());
|
R_UNLESS(this->offset < this->offset + size, ResultInvalidKeyValue());
|
||||||
|
|
||||||
std::memcpy(this->buffer.Get() + this->offset, src, size);
|
std::memcpy(this->buffer.Get() + this->offset, src, size);
|
||||||
this->offset += size;
|
this->offset += size;
|
||||||
|
Loading…
Reference in New Issue
Block a user