Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/print_battery_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ static bool slurp_battery_info(battery_info_ctx_t *ctx, struct battery_info *bat
batt_info->status = CS_DISCHARGING;
#elif defined(__OpenBSD__)
/*
* We're using apm(4) here, which is the interface to acpi(4) on amd64/i386 and
* the generic interface on macppc/sparc64/zaurus. Machines that have ACPI
* battery sensors gain some extra information.
*/
* We're using apm(4) here, which is the interface to acpi(4) on amd64/i386 and
* the generic interface on macppc/sparc64/zaurus. Machines that have ACPI
* battery sensors gain some extra information.
*/
struct apm_power_info apm_info;
struct sensordev sensordev;
struct sensor sensor;
Expand Down
2 changes: 1 addition & 1 deletion src/print_disk_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void print_disk_info(disk_info_ctx_t *ctx) {
#if defined(__DragonFly__) || defined(__APPLE__)
struct statfs buf;

if (statfs(path, &buf) == -1)
if (statfs(ctx->path, &buf) == -1)
return;

mounted = true;
Expand Down
8 changes: 4 additions & 4 deletions src/print_eth_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ static int print_eth_speed(char *outwalk, const char *interface) {

for (desc = ifm_subtype_descriptions; desc->ifmt_string != NULL; desc++) {
/*
* Skip these non-informative values and go right ahead to the
* actual speeds.
*/
* Skip these non-informative values and go right ahead to the
* actual speeds.
*/
if (BEGINS_WITH(desc->ifmt_string, "autoselect") ||
BEGINS_WITH(desc->ifmt_string, "auto"))
continue;
Expand Down Expand Up @@ -157,7 +157,7 @@ void print_eth_info(eth_info_ctx_t *ctx) {
/*
* Removing '%' and following characters from IPv6 since the interface identifier is redundant,
* as the output already includes the interface name.
*/
*/
if (ipv6_address != NULL) {
char *prct_ptr = strstr(ipv6_address, "%");
if (prct_ptr != NULL) {
Expand Down
9 changes: 6 additions & 3 deletions src/print_ip_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
static char *strip_optional_label(const char *ifa_name) {
char *copy = sstrdup(ifa_name);

char *ptr = strchr(copy, ':');
char *ptr1 = strchr(copy, ':');
char *ptr2 = strchr(copy, '@');

if (ptr) {
*ptr = '\0';
if (ptr1 && (ptr1 < ptr2)) {
*ptr1 = '\0';
} else if (ptr2) {
*ptr2 = '\0';
}

return copy;
Expand Down
8 changes: 4 additions & 4 deletions src/print_wireless_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ static int get_wireless_info(const char *interface, wireless_info_t *info) {
close(s);
if (na.i_len >= sizeof(u.req)) {
/*
* Just use the first BSSID returned even if there are
* multiple APs sharing the same BSSID.
*/
* Just use the first BSSID returned even if there are
* multiple APs sharing the same BSSID.
*/
info->signal_level = u.req.info[0].isi_rssi / 2 +
u.req.info[0].isi_noise;
info->flags |= WIRELESS_INFO_FLAG_HAS_SIGNAL;
Expand Down Expand Up @@ -523,7 +523,7 @@ void print_wireless_info(wireless_info_ctx_t *ctx) {
/*
* Removing '%' and following characters from IPv6 since the interface identifier is redundant,
* as the output already includes the interface name.
*/
*/
if (ipv6_address != NULL) {
char *prct_ptr = strstr(ipv6_address, "%");
if (prct_ptr != NULL) {
Expand Down