From 0f5e6bf980d5c582c4d56014f9dbf16926200c67 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Wed, 27 Nov 2013 15:14:22 -0500 Subject: [PATCH] Check the return value of system() --- tools/wlanconfig.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/wlanconfig.c b/tools/wlanconfig.c index 1c0ff91..3ccf049 100644 --- a/tools/wlanconfig.c +++ b/tools/wlanconfig.c @@ -776,7 +776,8 @@ list_keys(const char *ifname) strcpy(cmd, "iwlist "); strcat(cmd, ifname); strcat(cmd, " key"); - system(cmd); + if (system(cmd) != 0) + puts("Failed!"); } #define IEEE80211_C_BITS \ @@ -892,7 +893,8 @@ ieee80211_status(const char *ifname) puts("[status not implemented (yet). Spawning iwconfig...]"); strcpy(cmd, "iwconfig "); strcat(cmd, ifname); - system(cmd); + if (system(cmd) != 0) + puts("Failed!"); } static int -- 2.35.1