Skip to content

Commit fbd7945

Browse files
authored
Merge pull request #414 from HRex39/Fix-MinGW-Error
Fix MinGW Compiling Error
2 parents 449161c + 82344f8 commit fbd7945

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clickhouse/columns/ip4.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ in_addr ColumnIPv4::operator [] (size_t n) const {
6161

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

6566
char buf[INET_ADDRSTRLEN];
66-
const char* ip_str = inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN);
67+
const char* ip_str = inet_ntop(AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN);
6768

6869
if (ip_str == nullptr) {
6970
throw std::system_error(

clickhouse/columns/ip6.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ void ColumnIPv6::Clear() {
4444

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

4849
char buf[INET6_ADDRSTRLEN];
49-
const char* ip_str = inet_ntop(AF_INET6, &addr, buf, INET6_ADDRSTRLEN);
50+
const char* ip_str = inet_ntop(AF_INET6, &tmp_addr, buf, INET6_ADDRSTRLEN);
5051

5152
if (ip_str == nullptr) {
5253
throw std::system_error(

0 commit comments

Comments
 (0)