simplified wifi_essid by removing one malloc()
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 16:28:02 +0200
1 files changed,
1 insertions(+),
5 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -672,11 +672,7 @@ /* wifi essid */
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;