mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-26 16:09:26 -05:00
use size_t in offset test to fix warning
This commit is contained in:
parent
dcc80a01db
commit
c9c7dca498
@ -3,7 +3,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
static unsigned size_classes[] = {
|
static size_t size_classes[] = {
|
||||||
/* large */ 4 * 1024 * 1024,
|
/* large */ 4 * 1024 * 1024,
|
||||||
/* 0 */ 0,
|
/* 0 */ 0,
|
||||||
/* 16 */ 16, 32, 48, 64, 80, 96, 112, 128,
|
/* 16 */ 16, 32, 48, 64, 80, 96, 112, 128,
|
||||||
@ -32,7 +32,7 @@ int main(void) {
|
|||||||
|
|
||||||
void *p[N_SIZE_CLASSES];
|
void *p[N_SIZE_CLASSES];
|
||||||
for (unsigned i = 0; i < N_SIZE_CLASSES; i++) {
|
for (unsigned i = 0; i < N_SIZE_CLASSES; i++) {
|
||||||
unsigned size = size_classes[i];
|
size_t size = size_classes[i];
|
||||||
p[i] = malloc(size);
|
p[i] = malloc(size);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user