summary refs log tree commit diff stats
path: root/src/fe-text/fe-text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-text/fe-text.c')
-rw-r--r--src/fe-text/fe-text.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/fe-text/fe-text.c b/src/fe-text/fe-text.c
index c8b64ab0..209a3d03 100644
--- a/src/fe-text/fe-text.c
+++ b/src/fe-text/fe-text.c
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -78,7 +80,6 @@ fe_new_window (struct session *sess, int focus)
 {
 	char buf[512];
 
-	sess->gui = malloc (4);
 	current_sess = sess;
 
 	if (!sess->server->front_session)
@@ -92,13 +93,11 @@ fe_new_window (struct session *sess, int focus)
 		return;
 	done_intro = 1;
 
-	snprintf (buf, sizeof (buf),
+	g_snprintf (buf, sizeof (buf),
 				"\n"
 				" \017HexChat-Text \00310"PACKAGE_VERSION"\n"
-				" \017Running on \00310%s \017glib \00310%d.%d.%d\n"
-				" \017This binary compiled \00310"__DATE__"\017\n",
-				get_sys_str (1),
-				glib_major_version, glib_minor_version, glib_micro_version);
+				" \017Running on \00310%s\n",
+				get_sys_str (1));
 	fe_print_text (sess, buf, 0, FALSE);
 
 	fe_print_text (sess, "\n\nCompiled in Features\0032:\017 "
@@ -111,9 +110,6 @@ fe_new_window (struct session *sess, int focus)
 #ifdef USE_OPENSSL
 	"OpenSSL "
 #endif
-#ifdef USE_IPV6
-	"IPv6"
-#endif
 	"\n\n", 0, FALSE);
 	fflush (stdout);
 }
@@ -140,7 +136,7 @@ timecat (char *buf, time_t stamp)
 
 /* Windows doesn't handle ANSI codes in cmd.exe, need to not display them */
 #ifndef WIN32
-/*                       0  1  2  3  4  5  6  7   8   9   10 11  12  13  14 15 */
+/*                               0  1  2  3  4  5  6  7   8   9  10  11  12  13  14 15 */
 static const short colconv[] = { 0, 7, 4, 2, 1, 3, 5, 11, 13, 12, 6, 16, 14, 15, 10, 7 };
 
 void
@@ -151,7 +147,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
 	char num[8];
 	int reverse = 0, under = 0, bold = 0,
 		comma, k, i = 0, j = 0, len = strlen (text);
-	unsigned char *newtext = malloc (len + 1024);
+	unsigned char *newtext = g_malloc (len + 1024);
 
 	if (prefs.hex_stamp_text)
 	{
@@ -207,7 +203,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
 						else
 							col = 30;
 						mirc = atoi (num);
-						mirc = colconv[mirc];
+						mirc = colconv[mirc % G_N_ELEMENTS(colconv)];
 						if (mirc > 9)
 						{
 							mirc += 50;
@@ -308,7 +304,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
 
 	newtext[j] = 0;
 	write (STDOUT_FILENO, newtext, j);
-	free (newtext);
+	g_free (newtext);
 }
 #else
 /* The win32 version for cmd.exe */
@@ -319,7 +315,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
 	int dotime = FALSE;
 	int comma, k, i = 0, j = 0, len = strlen (text);
 
-	unsigned char *newtext = malloc (len + 1024);
+	unsigned char *newtext = g_malloc (len + 1024);
 
 	if (prefs.hex_stamp_text)
 	{
@@ -403,7 +399,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
 
 	newtext[j] = 0;
 	write (STDOUT_FILENO, newtext, j);
-	free (newtext);
+	g_free (newtext);
 }
 #endif
 
@@ -508,14 +504,14 @@ fe_args (int argc, char *argv[])
 	{
 #ifdef WIN32
 		/* see the chdir() below */
-		char *sl, *exe = strdup (argv[0]);
+		char *sl, *exe = g_strdup (argv[0]);
 		sl = strrchr (exe, '\\');
 		if (sl)
 		{
 			*sl = 0;
 			printf ("%s\\plugins\n", exe);
 		}
-		free (exe);
+		g_free (exe);
 #else
 		printf ("%s\n", HEXCHATLIBDIR);
 #endif
@@ -530,8 +526,7 @@ fe_args (int argc, char *argv[])
 
 	if (arg_cfgdir)	/* we want filesystem encoding */
 	{
-		if (xdir)
-			g_free (xdir);
+		g_free (xdir);
 		xdir = strdup (arg_cfgdir);
 		if (xdir[strlen (xdir) - 1] == '/')
 			xdir[strlen (xdir) - 1] = 0;
@@ -583,7 +578,6 @@ fe_exit (void)
 void
 fe_new_server (struct server *serv)
 {
-	serv->gui = malloc (4);
 }
 
 void
@@ -682,7 +676,7 @@ fe_progressbar_end (struct server *serv)
 {
 }
 void
-fe_userlist_insert (struct session *sess, struct User *newuser, int row, int sel)
+fe_userlist_insert (struct session *sess, struct User *newuser, gboolean sel)
 {
 }
 int
@@ -695,10 +689,6 @@ fe_userlist_rehash (struct session *sess, struct User *user)
 {
 }
 void
-fe_userlist_move (struct session *sess, struct User *user, int new_row)
-{
-}
-void
 fe_userlist_numbers (struct session *sess)
 {
 }
@@ -910,7 +900,6 @@ void fe_tray_set_flash (const char *filename1, const char *filename2, int timeou
 void fe_tray_set_file (const char *filename){}
 void fe_tray_set_icon (feicon icon){}
 void fe_tray_set_tooltip (const char *text){}
-void fe_tray_set_balloon (const char *title, const char *text){}
 void fe_userlist_update (session *sess, struct User *user){}
 void
 fe_open_chan_list (server *serv, char *filter, int do_refresh)