Skip to content

Commit

Permalink
Don't fall through between cases in light_mem_seek() (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacsLab42 authored Mar 29, 2024
1 parent 5ef660a commit 093fdf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
*.tmp
/.vs
/out
/build
3 changes: 3 additions & 0 deletions src/light_io_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ int light_mem_seek(void* context, long int offset, int origin)
{
case SEEK_SET:
new_offset = offset;
break;
case SEEK_CUR:
new_offset += offset;
break;
case SEEK_END:
new_offset = mem->size + offset;
break;
}
if (new_offset < 0 || new_offset > mem->size) {
return 1;
Expand Down

0 comments on commit 093fdf5

Please sign in to comment.