Skip to content

Commit

Permalink
Fix IP address printing: 4 hex digits per piece (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
klao committed Nov 15, 2023
1 parent 8b39b2f commit 09d6e64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/ip_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int main(int argc, char* argv[])
std::printf("0x");
auto count = value.version == 4 ? 2 : 8;
for (auto i = 0; i < count; ++i)
std::printf("%02X", value.pieces[i]);
std::printf("%04X", value.pieces[i]);
std::printf("\n");

return result ? 0 : 1;
Expand Down

0 comments on commit 09d6e64

Please sign in to comment.