vcpkg/ports/opentelemetry-cpp/add-missing-include-file.patch

25 lines
714 B
Diff
Raw Normal View History

diff --git a/exporters/jaeger/src/TUDPTransport.cc b/exporters/jaeger/src/TUDPTransport.cc
index e411127..a5e08fa 100644
--- a/exporters/jaeger/src/TUDPTransport.cc
+++ b/exporters/jaeger/src/TUDPTransport.cc
@@ -2,7 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
#include <sstream> // std::stringstream
-
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
#include "TUDPTransport.h"
#include "opentelemetry/sdk_config.h"
@@ -48,7 +50,7 @@ void TUDPTransport::open()
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
- sprintf(port, "%d", port_);
+ snprintf(port, sizeof(port), "%d", port_);
error = getaddrinfo(host_.c_str(), port, &hints, &server_addr_info_);