Skip to content

Commit

Permalink
Fix format specifiers used for ULONG (unsigned long)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-nsk committed Sep 5, 2023
1 parent 62a3267 commit 4b3aa76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net_adapter_winxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool net_adapter_enum(void *user_data, net_adapter_cb callback) {

error = GetAdaptersAddresses(AF_INET, GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_INCLUDE_GATEWAYS, 0, NULL, &buffer_size);
if (error != ERROR_SUCCESS && error != ERROR_BUFFER_OVERFLOW) {
LOG_ERROR("Unable to allocate memory for %s (%" PRId32 ")\n", "adapter info", error);
LOG_ERROR("Unable to allocate memory for %s (%lu)\n", "adapter info", error);

Check warning on line 34 in net_adapter_winxp.c

View check run for this annotation

Codecov / codecov/patch

net_adapter_winxp.c#L34

Added line #L34 was not covered by tests
return false;
}

Expand All @@ -42,7 +42,7 @@ bool net_adapter_enum(void *user_data, net_adapter_cb callback) {
error = GetAdaptersAddresses(AF_INET, GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_INCLUDE_GATEWAYS, 0,
(IP_ADAPTER_ADDRESSES *)buffer, &required_size);
if (error != ERROR_SUCCESS) {
LOG_ERROR("Unable to get adapter info (%d / %d:%d)\n", error, buffer_size, required_size);
LOG_ERROR("Unable to get adapter info (%lu / %lu:%lu)\n", error, buffer_size, required_size);

Check warning on line 45 in net_adapter_winxp.c

View check run for this annotation

Codecov / codecov/patch

net_adapter_winxp.c#L45

Added line #L45 was not covered by tests
goto net_adapter_cleanup;
}

Expand All @@ -67,7 +67,7 @@ bool net_adapter_enum(void *user_data, net_adapter_cb callback) {
if (adapter_addresses->OperStatus == IfOperStatusUp)
adapter.is_connected = true;
if (adapter_addresses->Flags & IP_ADAPTER_DHCP_ENABLED && adapter_addresses->Dhcpv4Enabled &&
adapter_addresses->Dhcpv4Server.iSockaddrLength >= sizeof(adapter.dhcp))
adapter_addresses->Dhcpv4Server.iSockaddrLength >= (int32_t)sizeof(adapter.dhcp))
adapter.is_dhcp_v4 = true;

// Populate adapter name, guid, and description
Expand Down

0 comments on commit 4b3aa76

Please sign in to comment.