Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clickhouse/columns/ip4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ in_addr ColumnIPv4::operator [] (size_t n) const {

std::string ColumnIPv4::AsString(size_t n) const {
const auto& addr = this->At(n);
auto tmp_addr = addr;

char buf[INET_ADDRSTRLEN];
const char* ip_str = inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN);
const char* ip_str = inet_ntop(AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN);

if (ip_str == nullptr) {
throw std::system_error(
Expand Down
3 changes: 2 additions & 1 deletion clickhouse/columns/ip6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ void ColumnIPv6::Clear() {

std::string ColumnIPv6::AsString (size_t n) const {
const auto& addr = this->At(n);
auto tmp_addr = addr;

char buf[INET6_ADDRSTRLEN];
const char* ip_str = inet_ntop(AF_INET6, &addr, buf, INET6_ADDRSTRLEN);
const char* ip_str = inet_ntop(AF_INET6, &tmp_addr, buf, INET6_ADDRSTRLEN);

if (ip_str == nullptr) {
throw std::system_error(
Expand Down
Loading