aboutsummaryrefslogtreecommitdiff
path: root/darwin.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2023-04-26 00:54:48 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2023-04-26 00:54:58 -0400
commit2c8c1166d81a5c0fe6f335742ee24319ce60bfa8 (patch)
treec58e738644f9595fae67e2ade0ecec35f8b7eca4 /darwin.c
parente71c07b9d5cc1236ca08536ae052faa5fc6b9096 (diff)
downloadwhatami-2c8c1166d81a5c0fe6f335742ee24319ce60bfa8.tar.gz
Use static storage
* Almost everything returned by the system is immutable * Fixed block_device array initialization and alphabetical sorting * Free memory where possible
Diffstat (limited to 'darwin.c')
-rw-r--r--darwin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/darwin.c b/darwin.c
index 843ee93..4a5986b 100644
--- a/darwin.c
+++ b/darwin.c
@@ -2,12 +2,12 @@
#include "common.h"
char *get_sys_product_darwin() {
- char model[100] = {0};
+ static char model[100] = {0};
size_t len;
len = sizeof(model);
sysctlbyname("hw.model", model, &len, NULL, 0);
- return strdup(model);
+ return model;
}
ssize_t get_sys_memory() {