Skip to content

Commit

Permalink
Make EOL of type size_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Jul 9, 2021
1 parent 4bfca55 commit 09027e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions libyara/arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ static int _yr_arena_make_ptr_relocatable(
yr_arena_off_t base_offset,
va_list offsets)
{
yr_arena_off_t offset;
size_t offset;

int result = ERROR_SUCCESS;

// The argument to va_arg is size_t because the offsets passed to this
// function are obtained with offsetof().
offset = (yr_arena_off_t) va_arg(offsets, size_t);
offset = va_arg(offsets, size_t);

while (offset != EOL)
{
Expand All @@ -93,7 +93,7 @@ static int _yr_arena_make_ptr_relocatable(
return ERROR_INSUFFICIENT_MEMORY;

reloc->buffer_id = buffer_id;
reloc->offset = base_offset + offset;
reloc->offset = base_offset + (yr_arena_off_t) offset;
reloc->next = NULL;

if (arena->reloc_list_head == NULL)
Expand All @@ -103,7 +103,7 @@ static int _yr_arena_make_ptr_relocatable(
arena->reloc_list_tail->next = reloc;

arena->reloc_list_tail = reloc;
offset = (yr_arena_off_t) va_arg(offsets, size_t);
offset = va_arg(offsets, size_t);
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion libyara/include/yara/arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <yara/limits.h>
#include <yara/stream.h>

#define EOL ((uint32_t) -1)
#define EOL ((size_t) -1)

#define YR_ARENA_FILE_VERSION 18

Expand Down

0 comments on commit 09027e5

Please sign in to comment.