Fix various bugs from static analysis in a test file 56/172356/1
authorTaesoo Jun <steve.jun@samsung.com>
Tue, 13 Mar 2018 10:22:41 +0000 (19:22 +0900)
committerTaesoo Jun <steve.jun@samsung.com>
Tue, 13 Mar 2018 10:22:41 +0000 (19:22 +0900)
Change-Id: Ic134afb2d20215b8a9826fbb804facbdc5c9be81

test/wifi_direct_test.c

index df1c133..69d391e 100644 (file)
@@ -62,7 +62,7 @@ static const char *test_wfd_convert_error_to_string(wifi_direct_error_e err_type
        case WIFI_DIRECT_ERROR_CONNECTION_CANCELED:
                return "CONNECTION_CANCELED";
        default:
-               return "UNKNOWN";
+               break;
        }
        return "UNKNOWN";
 }
@@ -985,9 +985,10 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st
                                if (scanf(" %8s", pin) < 1)
                                        break;
 
-                               if (strlen(pin) > 0)
+                               if (strlen(pin) > 0) {
                                        result = wifi_direct_set_wps_pin(pin);
-                               else
+                                       printf("wifi_direct_set_wps_pin() result=[%d]\n", result);
+                               } else
                                        printf("Invalid PIN number\n");
 
                } else {
@@ -2089,6 +2090,7 @@ void process_input(const char *input, gpointer user_data)
                                printf("Enter contact info\n");
                                if (scanf(" %50ms", &str) < 1)
                                        break;
+                               info1 = str;
                        break;
                        default:
                                printf("ERROR : Invalid input service_type!!!\n");