From 85db24fef03fe611c3ac8151f9249af282ae9915 Mon Sep 17 00:00:00 2001 From: Aaron Marcher Date: Mon, 15 Aug 2016 16:28:02 +0200 Subject: simplified wifi_essid by removing one malloc() --- slstatus.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/slstatus.c b/slstatus.c index 505f25d..bd1fe66 100644 --- a/slstatus.c +++ b/slstatus.c @@ -672,11 +672,7 @@ wifi_perc(const char *wificard) char * wifi_essid(const char *wificard) { - char *id = malloc(IW_ESSID_MAX_SIZE+1); - if (id == NULL) { - fprintf(stderr, "Cannot get ESSID."); - return smprintf("n/a"); - } + char id[IW_ESSID_MAX_SIZE+1]; int sockfd; struct iwreq wreq; -- cgit v1.2.3