Skip to content

Commit

Permalink
refs is atomic_size_t (#976)
Browse files Browse the repository at this point in the history
The unassert covers all invalid values rather than a third of them.
  • Loading branch information
mrdomino authored Dec 3, 2023
1 parent 450d9b1 commit 8dd3480
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libc/runtime/zipos-open.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "libc/thread/tls.h"
#include "libc/zip.internal.h"

#define MAX_REFS (INT_MAX >> 1)
#define MAX_REFS SSIZE_MAX

static char *__zipos_mapend;
static size_t __zipos_maptotal;
Expand Down
2 changes: 1 addition & 1 deletion libc/runtime/zipos.internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ZiposHandle {
size_t size;
size_t mapsize;
size_t cfile;
_Atomic(int) refs;
_Atomic(size_t) refs;
_Atomic(size_t) pos;
uint8_t *mem;
uint8_t data[];
Expand Down

0 comments on commit 8dd3480

Please sign in to comment.