diff --git a/CMakeLists.txt b/CMakeLists.txt index 413a0f82..7204576e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,13 +134,13 @@ if (${ONION_USE_XML2}) endif(${ONION_USE_XML2}) if (${ONION_USE_PAM}) - find_library(PAM_LIB NAMES pam PATH ${LIBPATH}) - if (PAM_LIB) + find_package(PAM) + if (PAM_FOUND) set(PAM_ENABLED true) - message(STATUS "pam found. PAM support is compiled in in handlers.") - else (PAM_LIB) - message("pam not found. No PAM support.") - endif (PAM_LIB) + message(STATUS "PAM support is compiled in handlers.") + else (PAM_FOUND) + message("No PAM support.") + endif (PAM_FOUND) endif (${ONION_USE_PAM}) if (${ONION_USE_PNG}) diff --git a/tests/01-internal/14-websockets.c b/tests/01-internal/14-websockets.c index 25645c8c..c5b8b606 100644 --- a/tests/01-internal/14-websockets.c +++ b/tests/01-internal/14-websockets.c @@ -187,7 +187,7 @@ void t02_websocket_server_w_ws(){ void t03_websocket_server_receive_small_packet(){ INIT_LOCAL(); int length = 0; - char *buffer = NULL, buffer2[114]; + char *buffer = NULL, buffer2[115]; memset(&ws_status,0,sizeof(ws_status)); onion *o=websocket_server_new(); onion_request *req=websocket_start_handshake(o); @@ -201,7 +201,7 @@ void t03_websocket_server_receive_small_packet(){ onion_websocket_read(ws, (char *)&buffer2, 120); - buffer2[113] = '\0'; + buffer2[114] = '\0'; FAIL_IF_NOT_EQUAL_STR(buffer2, "Some UTF-8-encoded chars which will be cut at the 117th char so I write some gap-filling text with no meaning unti"); onion_websocket_free(ws);