Fix gcc9 warning 17/220917/1 accepted/tizen/unified/20191227.142744 submit/tizen/20191226.234511
authorSemun Lee <semun.lee@samsung.com>
Thu, 26 Dec 2019 01:42:16 +0000 (10:42 +0900)
committerSemun Lee <semun.lee@samsung.com>
Thu, 26 Dec 2019 01:43:05 +0000 (10:43 +0900)
error: '%s' directive argument is null [-Werror=format-overflow=]

Change-Id: I811c89262b91516c49601ce0e6d8d04a279edb2b
Signed-off-by: Semun Lee <semun.lee@samsung.com>
src/libnetwork_mptcp.c

index ded5052..b9b05f8 100755 (executable)
@@ -122,13 +122,14 @@ int _connection_libnet_mptcp_set_path_manager(connection_handle_s *conn_handle,
 {
        int rv = 0;
        const char* str = __convert_mptcp_path_manager_enum_to_str(pm);
-       CONNECTION_LOG(CONNECTION_ERROR, "set path manager %s", str);
 
        if (str == NULL) {
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid Parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       CONNECTION_LOG(CONNECTION_ERROR, "set path manager %s", str);
+
        rv = net_mptcp_set_path_manager(conn_handle->network_info_handle, str);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE
@@ -166,13 +167,14 @@ int _connection_libnet_mptcp_set_scheduler(connection_handle_s *conn_handle, con
 {
        int rv = 0;
        const char *str = __convert_mptcp_scheduler_enum_to_str(scheduler);
-       CONNECTION_LOG(CONNECTION_ERROR, "set scheduler %s", str);
 
        if (str == NULL) {
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid Parameter");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       CONNECTION_LOG(CONNECTION_ERROR, "set scheduler %s", str);
+
        rv = net_mptcp_set_scheduler(conn_handle->network_info_handle, str);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");      //LCOV_EXCL_LINE