Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Aug 6, 2023
1 parent 1018b11 commit 335cbb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ target_include_directories(civetweb PUBLIC civetweb/include)
# rtmp ?
find_package(PkgConfig QUIET)
pkg_check_modules(RTMP QUIET librtmp)
MESSAGE("RTMP_FOUND = ${RTMP_FOUND}")
MESSAGE("RTMP_FOUND = ${RTMP_FOUND} RTMP_INCLUDE_DIRS=${RTMP_INCLUDE_DIRS} RTMP_LIBRARIES=${RTMP_LIBRARIES}")
if (RTMP_FOUND)
add_definitions(-DHAVE_RTMP)
target_link_libraries (${CMAKE_PROJECT_NAME} ${RTMP_LIBRARIES})
Expand Down
4 changes: 2 additions & 2 deletions src/HttpServerRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class PrometheusHandler : public CivetHandler

static std::vector<std::string> read_proc_stat() {
char stat_path[32];
std::sprintf(stat_path, "/proc/%d/stat", getpid());
std::snprintf(stat_path, sizeof(stat_path),"/proc/%d/stat", getpid());
std::ifstream file(stat_path);
std::string line;
std::getline(file, line);
Expand All @@ -212,7 +212,7 @@ class PrometheusHandler : public CivetHandler

static long get_fds_total() {
char fd_path[32];
std::sprintf(fd_path, "/proc/%d/fd", getpid());
std::snprintf(fd_path, sizeof(fd_path), "/proc/%d/fd", getpid());

long file_total = 0;
DIR *dirp = opendir(fd_path);
Expand Down

0 comments on commit 335cbb3

Please sign in to comment.