[hackers] [slstatus] wifi_essid: Fix coding style || Aaron Marcher

From: <git_AT_suckless.org>
Date: Thu, 17 May 2018 18:00:00 +0200 (CEST)

commit 1c44d404f602a7e477def6572c2f620a6970b244
Author: Aaron Marcher <me_AT_drkhsh.at>
AuthorDate: Thu May 17 17:59:05 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Thu May 17 17:59:05 2018 +0200

    wifi_essid: Fix coding style
    
    Only initialize variables at the beginning of a block

diff --git a/components/wifi.c b/components/wifi.c
index 7dfa4e2..473c8a7 100644
--- a/components/wifi.c
+++ b/components/wifi.c
_AT_@ -66,14 +66,14 @@
         wifi_essid(const char *iface)
         {
                 static char id[IW_ESSID_MAX_SIZE+1];
- int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+ int sockfd;
                 struct iwreq wreq;
 
                 memset(&wreq, 0, sizeof(struct iwreq));
                 wreq.u.essid.length = IW_ESSID_MAX_SIZE+1;
                 snprintf(wreq.ifr_name, sizeof(wreq.ifr_name), "%s", iface);
 
- if (sockfd < 0) {
+ if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
                         fprintf(stderr, "socket 'AF_INET': %s\n",
                                 strerror(errno));
                         return NULL;
Received on Thu May 17 2018 - 18:00:00 CEST

This archive was generated by hypermail 2.3.0 : Thu May 17 2018 - 18:00:28 CEST