Skip to content

Commit 96a9747

Browse files
committed
bugfix secondary memory loader dividing by sizeof(uint32_t) twice
1 parent 731ded8 commit 96a9747

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

klib/entry/secondary.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ namespace klib::entry {
4141
break;
4242
}
4343

44-
// get the length of the segment
45-
const uint32_t length = ((segment->end - segment->start) + (sizeof(uint32_t) - 1)) / sizeof(uint32_t);
44+
// get the length of the segment in elements
45+
const uint32_t length = (segment->end - segment->start);
4646

4747
// check if we have any length to copy
4848
if (!length) {
@@ -63,8 +63,8 @@ namespace klib::entry {
6363
break;
6464
}
6565

66-
// get the length of the segment
67-
const uint32_t length = ((segment->end - segment->start) + (sizeof(uint32_t) - 1)) / sizeof(uint32_t);
66+
// get the length of the segment in elements
67+
const uint32_t length = (segment->end - segment->start);
6868

6969
// check if we have any length to copy
7070
if (!length) {

0 commit comments

Comments
 (0)