commit 4ae22db8ac5242d519d54b48c3995543c09fa765
parent d587fb51a38ce982a685edfd6396f782da34f2f7
Author: sam-barr <samfbarr@outlook.com>
Date: Wed, 22 Apr 2020 08:40:14 -0500
Merge pull request #7 from allisio/master
Let getline() handle buffer allocation in get_memory()
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/paleofetch.c b/paleofetch.c
@@ -187,7 +187,7 @@ char *get_memory() {
}
/* We parse through all lines of meminfo and scan for the information we need */
- char *line = malloc(BUF_SIZE);
+ char *line = NULL; // allocation handled automatically by getline()
size_t len; /* unused */
/* parse until EOF */