Skip to content

Commit

Permalink
tests/malloc: remove 0x prefix for %p in printf
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Feb 17, 2023
1 parent fd47a1b commit 99e07a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/malloc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static uint32_t fill_memory(struct node *head)

total = 0;
while (head && (head->ptr = malloc(CHUNK_SIZE)) && total < MAX_MEM) {
printf("Allocated %"PRIu32" Bytes at 0x%p, total %"PRIu32"\n",
printf("Allocated %"PRIu32" Bytes at %p, total %"PRIu32"\n",
(uint32_t)CHUNK_SIZE, head->ptr, total += CHUNK_SIZE);
memset(head->ptr, '@', CHUNK_SIZE);
head = head->next = malloc(sizeof(struct node));
Expand Down Expand Up @@ -88,7 +88,7 @@ static void free_memory(struct node *head)
total -= CHUNK_SIZE;
freed++;
}
printf("Free %"PRIu32" Bytes at 0x%p, total %"PRIu32"\n",
printf("Free %"PRIu32" Bytes at %p, total %"PRIu32"\n",
(uint32_t)CHUNK_SIZE, head->ptr, total);
free(head->ptr);
}
Expand Down

0 comments on commit 99e07a6

Please sign in to comment.