summaryrefslogtreecommitdiff
path: root/nncmpp.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-10 21:31:31 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-10 21:31:31 +0200
commit525e952753cc218a2be15438689d8ed2f5d97b50 (patch)
treec2dfd8a9ae76e2ea198bcb83e9eeeacd07f9b569 /nncmpp.c
parent8707b38c4863f1e8765116064071ee6774e541b3 (diff)
downloadnncmpp-525e952753cc218a2be15438689d8ed2f5d97b50.tar.gz
nncmpp-525e952753cc218a2be15438689d8ed2f5d97b50.tar.xz
nncmpp-525e952753cc218a2be15438689d8ed2f5d97b50.zip
Bump liberty and termo
Diffstat (limited to 'nncmpp.c')
-rw-r--r--nncmpp.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/nncmpp.c b/nncmpp.c
index 0c95fef..cf616a8 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -174,7 +174,7 @@ print_curl_debug (CURL *easy, curl_infotype type, char *data, size_t len,
for (size_t i = 0; i < len; i++)
{
uint8_t c = data[i];
- copy[i] = c >= 32 || c == '\n' ? c : '.';
+ copy[i] = !iscntrl_ascii (c) || c == '\n' ? c : '.';
}
copy[len] = '\0';
@@ -2520,8 +2520,7 @@ library_tab_change_level (const char *new_path)
str_reset (path);
str_append (path, new_path);
- free (g_library_tab.super.header);
- g_library_tab.super.header = NULL;
+ cstr_set (&g_library_tab.super.header, NULL);
g_library_tab.super.item_mark = -1;
if (path->len)
@@ -2719,8 +2718,7 @@ library_tab_on_action (enum action action)
free (fake_subdir);
}
- free (tab->header);
- tab->header = xstrdup_printf ("Global search");
+ cstr_set (&tab->header, xstrdup_printf ("Global search"));
g_library_tab.searching = true;
// Since we've already changed the header, empty the list,
@@ -2876,7 +2874,7 @@ streams_tab_extract_links (struct str *data, const char *content_type,
for (size_t i = 0; i < data->len; i++)
{
uint8_t c = data->str[i];
- if ((c < 32) & (c != '\t') & (c != '\r') & (c != '\n'))
+ if (iscntrl_ascii (c) & (c != '\t') & (c != '\r') & (c != '\n'))
return false;
}
@@ -3860,8 +3858,7 @@ app_on_message_timer (void *user_data)
{
(void) user_data;
- free (g.message);
- g.message = NULL;
+ cstr_set (&g.message, NULL);
app_invalidate ();
}
@@ -3889,8 +3886,7 @@ app_log_handler (void *user_data, const char *quote, const char *fmt,
user_data == NULL ? 0 : g.attrs[(intptr_t) user_data].attrs);
else
{
- free (g.message);
- g.message = xstrdup (message.str);
+ cstr_set (&g.message, xstrdup (message.str));
app_invalidate ();
poller_timer_set (&g.message_timer, 5000);
}