mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Address some minor stylish nits
This commit is contained in:
parent
fed791ed91
commit
474ee8ee70
@ -81,25 +81,25 @@ static void cap_emit_signal (IRC_SERVER_REC *server, char *cmd, char *args)
|
|||||||
|
|
||||||
static gboolean parse_cap_name(char *name, char **key, char **val)
|
static gboolean parse_cap_name(char *name, char **key, char **val)
|
||||||
{
|
{
|
||||||
|
const char *eq;
|
||||||
|
|
||||||
g_return_val_if_fail(name != NULL, FALSE);
|
g_return_val_if_fail(name != NULL, FALSE);
|
||||||
g_return_val_if_fail(name[0] != '\0', FALSE);
|
g_return_val_if_fail(name[0] != '\0', FALSE);
|
||||||
|
|
||||||
const char *eq = strchr(name, '=');
|
eq = strchr(name, '=');
|
||||||
/* KEY only value */
|
/* KEY only value */
|
||||||
if (eq == NULL) {
|
if (eq == NULL) {
|
||||||
*key = g_strdup(name);
|
*key = g_strdup(name);
|
||||||
*val = NULL;
|
*val = NULL;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
/* Some values are in a KEY=VALUE form, parse them */
|
/* Some values are in a KEY=VALUE form, parse them */
|
||||||
else if (eq[1] != '\0') {
|
} else if (eq[1] != '\0') {
|
||||||
*key = g_strndup(name, (gsize)(eq - name));
|
*key = g_strndup(name, (gsize)(eq - name));
|
||||||
*val = g_strdup(eq + 1);
|
*val = g_strdup(eq + 1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
/* If the string ends after the '=' consider the value
|
/* If the string ends after the '=' consider the value
|
||||||
* as invalid */
|
* as invalid */
|
||||||
else {
|
} else {
|
||||||
*key = NULL;
|
*key = NULL;
|
||||||
*val = NULL;
|
*val = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -444,8 +444,8 @@ static void sig_disconnected(IRC_SERVER_REC *server)
|
|||||||
server->cap_active = NULL;
|
server->cap_active = NULL;
|
||||||
|
|
||||||
if (server->cap_supported) {
|
if (server->cap_supported) {
|
||||||
g_hash_table_destroy(server->cap_supported);
|
g_hash_table_destroy(server->cap_supported);
|
||||||
server->cap_supported = NULL;
|
server->cap_supported = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free);
|
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free);
|
||||||
|
Loading…
Reference in New Issue
Block a user