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

Fix #1424, api warning listInterfaces #1428

Closed
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
2 changes: 1 addition & 1 deletion src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ static bool listInterfaces(struct if_info **head, char default_iface[IF_NAMESIZE
while ((dp = readdir(dfd)) != NULL)
{
// Skip "." and ".."
if(!dp->d_name || strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
if(strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
continue;

// Create new interface record
Expand Down
12 changes: 6 additions & 6 deletions src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,19 @@ static inline bool __attribute__ ((const)) is_term(void)
}

// Returns green [✓]
const char __attribute__ ((const)) *cli_tick(void)
const char __attribute__ ((const, pure)) *cli_tick(void)
{
return is_term() ? "["COL_GREEN"✓"COL_NC"]" : "[✓]";
}

// Returns red [✗]
const char __attribute__ ((const)) *cli_cross(void)
const char __attribute__ ((const, pure)) *cli_cross(void)
{
return is_term() ? "["COL_RED"✗"COL_NC"]" : "[✗]";
}

// Returns [i]
const char __attribute__ ((const)) *cli_info(void)
const char __attribute__ ((const, pure)) *cli_info(void)
{
return is_term() ? COL_BOLD"[i]"COL_NC : "[i]";
}
Expand All @@ -434,19 +434,19 @@ const char __attribute__ ((const)) *cli_qst(void)
}

// Returns green "done!""
const char __attribute__ ((const)) *cli_done(void)
const char __attribute__ ((const, pure)) *cli_done(void)
{
return is_term() ? COL_GREEN"done!"COL_NC : "done!";
}

// Sets font to bold
const char __attribute__ ((const)) *cli_bold(void)
const char __attribute__ ((const, pure)) *cli_bold(void)
{
return is_term() ? COL_BOLD : "";
}

// Resets font to normal
const char __attribute__ ((const)) *cli_normal(void)
const char __attribute__ ((const, pure)) *cli_normal(void)
{
return is_term() ? COL_NC : "";
}