Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NM plugin fixes #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions nm/src/nm.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,11 @@ _j4status_nm_device_update(J4statusPluginContext *context, J4statusNmSection *se
if ( context->formats.up_wifi_tokens & TOKEN_FLAG_UP_WIFI_SSID )
{
GBytes *raw_ssid = nm_access_point_get_ssid(section->ap);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, that’s new from the libnm merge, so you need to say that in the commit message.

data.ssid = g_variant_new_take_string(g_strndup(g_bytes_get_data(raw_ssid, NULL),
g_bytes_get_size(raw_ssid)));
if (raw_ssid) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition must be in the previous commit as it’s the one introducing the NULL case.

Nit: also 3 style issues here: spaces around parens, != NULL and bracket on the following line

char *active_ssid_str = nm_utils_ssid_to_utf8(g_bytes_get_data (raw_ssid, NULL),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: gchar, and you can just call it ssid or just put the function call in g_variant_new_take_string()

g_bytes_get_size (raw_ssid));
data.ssid = g_variant_new_take_string(active_ssid_str);
}
}
}

Expand Down