From 21e8ea14868844ff424c3e6f28dca41ee28e2842 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 8 Oct 2022 12:29:19 +0200 Subject: [PATCH] apps: make memeater use strerror() --- apps/src/memeater.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/src/memeater.c b/apps/src/memeater.c index 8e683637..dcd6755c 100644 --- a/apps/src/memeater.c +++ b/apps/src/memeater.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #define CHUNK 4194304 // 4 MB @@ -14,6 +15,6 @@ int main() printf("Allocating 4 MB of memory... %lx\n", (unsigned long)allocated); sleep(1); } while ((allocated = malloc(CHUNK))); - printf("Out of memory. (errno=%d)\n", errno); + printf("Out of memory. (errno=%d, %s)\n", errno, strerror(errno)); printf("Press any key to restart.\n"); } \ No newline at end of file