From 40099feb80951f2a9f131d136d85074ecb8c0016 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 8 Oct 2022 18:11:41 +0200 Subject: [PATCH] Apps: Use the new %p in printf() --- apps/src/init.c | 2 +- apps/src/memeater.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/src/init.c b/apps/src/init.c index 8f23a859..b03c1d24 100644 --- a/apps/src/init.c +++ b/apps/src/init.c @@ -28,7 +28,7 @@ int main() { char* variable = malloc(200); *variable = 3; - printf("Allocated variable at address %lx\n", (unsigned long int)variable); + printf("Allocated variable at address %p\n", variable); free(variable); } diff --git a/apps/src/memeater.c b/apps/src/memeater.c index 1fb24091..d8e87306 100644 --- a/apps/src/memeater.c +++ b/apps/src/memeater.c @@ -12,7 +12,7 @@ int main() sleep(1); void* allocated = malloc(CHUNK); do { - printf("Allocating 4 MB of memory... %lx\n", (unsigned long)allocated); + printf("Allocating 4 MB of memory... %p\n", allocated); sleep(1); } while ((allocated = malloc(CHUNK))); perror("malloc");