diff --git a/src/commotion.c b/src/commotion.c index 1015f0e..01c5d2d 100644 --- a/src/commotion.c +++ b/src/commotion.c @@ -189,7 +189,8 @@ co_call(co_obj_t *connection, co_obj_t **response, const char *method, const siz CHECK(connection != NULL && IS_SOCK(connection), "Invalid connection."); co_obj_t *params = NULL, *rlist = NULL, *rtree = NULL; int retval = 0; - size_t reqlen = 0, resplen = 0; + size_t reqlen = 0; + ssize_t resplen = 0; char req[REQUEST_MAX]; char resp[RESPONSE_MAX]; if(request != NULL) diff --git a/src/daemon.c b/src/daemon.c index 39d77dd..97dab16 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -179,8 +179,8 @@ CMD(up) unsigned int chan; CHECK(co_profile_get_str(prof, &ip, "ip", sizeof("ip")), "Failed to get 'ip' option."); CHECK(co_profile_get_str(prof, &netmask, "netmask", sizeof("netmask")), "Failed to get 'netmask' option."); - CHECK(co_profile_get_str(prof, &ipgen, "ipgenerate", sizeof("ipgenerate")), "Failed to get 'ipgenerate' option."); - CHECK(co_profile_get_str(prof, &ipgenmask, "ipgeneratemask", sizeof("ipgeneratemask")), "Failed to get 'ipgeneratemask' option."); + CHECK(co_profile_get_str(prof, &ipgen, "ipgen", sizeof("ipgen")), "Failed to get 'ipgen' option."); + CHECK(co_profile_get_str(prof, &ipgenmask, "ipgenmask", sizeof("ipgenmask")), "Failed to get 'ipgenmask' option."); CHECK(co_profile_get_str(prof, &ssid, "ssid", sizeof("ssid")), "Failed to get 'ssid' option."); CHECK(co_profile_get_str(prof, &bssid, "bssid", sizeof("bssid")), "Failed to get 'bssid' option."); CHECK(co_profile_get_str(prof, &mode, "mode", sizeof("mode")), "Failed to get 'mode' option."); @@ -703,7 +703,7 @@ int dispatcher_cb(co_obj_t *self, co_obj_t *fd) { co_socket_t *sock = (co_socket_t*)self; char reqbuf[REQUEST_MAX]; memset(reqbuf, '\0', sizeof(reqbuf)); - size_t reqlen = 0; + ssize_t reqlen = 0; char respbuf[RESPONSE_MAX]; memset(respbuf, '\0', sizeof(respbuf)); size_t resplen = 0; diff --git a/src/iface.c b/src/iface.c index c9d03f7..dc11893 100644 --- a/src/iface.c +++ b/src/iface.c @@ -101,7 +101,7 @@ static int _co_iface_wpa_remove_network(co_obj_t *iface_obj) { size_t len; CHECK(_co_iface_wpa_command(iface_obj, "REMOVE_NETWORK", buf, &len), "Failed to remove network from wpa_supplicant."); - DEBUG("Removed wpa_supplicant network #%d", iface->wpa_id); + DEBUG("Removed wpa_supplicant network #%d", ((co_iface_t *)iface_obj)->wpa_id); return 1; error: return 0; @@ -112,7 +112,7 @@ static int _co_iface_wpa_disable_network(co_obj_t *iface_obj) { size_t len; CHECK(_co_iface_wpa_command(iface_obj, "DISABLE_NETWORK", buf, &len), "Failed to remove network from wpa_supplicant."); - DEBUG("Disabled wpa_supplicant network #%d", iface->wpa_id); + DEBUG("Disabled wpa_supplicant network #%d", ((co_iface_t *)iface_obj)->wpa_id); return 1; error: return 0; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c0764d4..faa43e5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,12 +32,11 @@ file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/*.cpp) add_executable(${PROJECT_TEST_NAME} ${TEST_SRC_FILES}) add_dependencies(${PROJECT_TEST_NAME} googletest) - target_link_libraries(${PROJECT_TEST_NAME} commotion) -target_link_libraries(${PROJECT_TEST_NAME} pthread) target_link_libraries(${PROJECT_TEST_NAME} ${GTEST_LIBS_DIR}/libgtest.a ${GTEST_LIBS_DIR}/libgtest_main.a) +target_link_libraries(${PROJECT_TEST_NAME} pthread) add_test(test1 ${PROJECT_TEST_NAME})