Browse Source

Silence printf() calls in wpa_gui to avoid stdout output from a GUI program

Jouni Malinen 16 years ago
parent
commit
3b14fb0cab
2 changed files with 10 additions and 1 deletions
  1. 1 1
      wpa_supplicant/wpa_gui-qt4/main.cpp
  2. 9 0
      wpa_supplicant/wpa_gui-qt4/wpagui.cpp

+ 1 - 1
wpa_supplicant/wpa_gui-qt4/main.cpp

@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_NATIVE_WINDOWS
 	WSADATA wsaData;
 	if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {
-		printf("Could not find a usable WinSock.dll\n");
+		/* printf("Could not find a usable WinSock.dll\n"); */
 		return -1;
 	}
 #endif /* CONFIG_NATIVE_WINDOWS */

+ 9 - 0
wpa_supplicant/wpa_gui-qt4/wpagui.cpp

@@ -28,6 +28,15 @@
 #include "userdatarequest.h"
 #include "networkconfig.h"
 
+#if 1
+/* Silence stdout */
+#define printf wpagui_printf
+static int wpagui_printf(const char *, ...)
+{
+	return 0;
+}
+#endif
+
 WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags)
 	: QMainWindow(parent)
 {