diff options
Diffstat (limited to 'src/common/chanopt.c')
-rw-r--r-- | src/common/chanopt.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/chanopt.c b/src/common/chanopt.c index 820a31fb..7bd66b4a 100644 --- a/src/common/chanopt.c +++ b/src/common/chanopt.c @@ -119,7 +119,7 @@ chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]) if (!quiet) PrintTextf (sess, "\002Network\002: %s \002Channel\002: %s\n", sess->server->network ? server_get_network (sess->server, TRUE) : _("<none>"), - sess->channel[0] ? sess->channel : _("<none>")); + sess->session_name[0] ? sess->session_name : _("<none>")); while (i < sizeof (chanopt) / sizeof (channel_options)) { @@ -208,7 +208,7 @@ chanopt_find (char *network, char *channel, gboolean add_new) return NULL; /* allocate a new one */ - co = g_malloc0 (sizeof (chanopt_in_memory)); + co = g_new0 (chanopt_in_memory, 1); co->channel = g_strdup (channel); co->network = g_strdup (network); @@ -298,7 +298,7 @@ chanopt_load (session *sess) chanopt_in_memory *co; char *network; - if (sess->channel[0] == 0) + if (sess->session_name[0] == 0) return; network = server_get_network (sess->server, FALSE); @@ -311,7 +311,7 @@ chanopt_load (session *sess) chanopt_load_all (); } - co = chanopt_find (network, sess->channel, FALSE); + co = chanopt_find (network, sess->session_name, FALSE); if (!co) return; @@ -334,7 +334,7 @@ chanopt_save (session *sess) chanopt_in_memory *co; char *network; - if (sess->channel[0] == 0) + if (sess->session_name[0] == 0) return; network = server_get_network (sess->server, FALSE); @@ -343,7 +343,7 @@ chanopt_save (session *sess) /* 2. reconcile sess with what we loaded from disk */ - co = chanopt_find (network, sess->channel, TRUE); + co = chanopt_find (network, sess->session_name, TRUE); i = 0; while (i < sizeof (chanopt) / sizeof (channel_options)) @@ -368,10 +368,10 @@ chanopt_save_one_channel (chanopt_in_memory *co, int fh) char buf[256]; guint8 val; - snprintf (buf, sizeof (buf), "%s = %s\n", "network", co->network); + g_snprintf (buf, sizeof (buf), "%s = %s\n", "network", co->network); write (fh, buf, strlen (buf)); - snprintf (buf, sizeof (buf), "%s = %s\n", "channel", co->channel); + g_snprintf (buf, sizeof (buf), "%s = %s\n", "channel", co->channel); write (fh, buf, strlen (buf)); i = 0; @@ -380,7 +380,7 @@ chanopt_save_one_channel (chanopt_in_memory *co, int fh) val = G_STRUCT_MEMBER (guint8, co, chanopt[i].offset); if (val != SET_DEFAULT) { - snprintf (buf, sizeof (buf), "%s = %d\n", chanopt[i].name, val); + g_snprintf (buf, sizeof (buf), "%s = %d\n", chanopt[i].name, val); write (fh, buf, strlen (buf)); } i++; |