vcpkg/ports/opentelemetry-cpp/add-missing-include-file.patch
Frank 7c13895ff7
[opentelemetry-cpp] Fix warning and miss include files (#33861)
* [opentelemetry-cpp] Fix warning and miss include files

* version

* update patch

* version
2023-09-22 16:03:49 -07:00

25 lines
714 B
Diff

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_);