changeset 1722:1edc8b545d6f

[gaim-migrate @ 1732] bugfixes and mem plugs committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 17 Apr 2001 20:42:47 +0000
parents 15096a01cd23
children 76e601b77099
files src/dialogs.c src/server.c
diffstat 2 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Mon Apr 16 17:04:15 2001 +0000
+++ b/src/dialogs.c	Tue Apr 17 20:42:47 2001 +0000
@@ -3592,10 +3592,12 @@
 	FILE *fp_old, *fp_new;
 	char filename[PATHSIZE];
 	char *name;
+	char *tmp;
 
 	name = gtk_object_get_user_data(GTK_OBJECT(filesel));
-	g_snprintf(filename, PATHSIZE, "%s/logs/%s.log", 
-		   gaim_user_dir(), normalize(name));
+	tmp = gaim_user_dir();
+	g_snprintf(filename, PATHSIZE, "%s/logs/%s.log", tmp, normalize(name));
+	g_free(tmp);
 
 	file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
 	strncpy(path, file, PATHSIZE-1);
@@ -3664,9 +3666,11 @@
 	gchar buf[256];
 	gchar filename[256];
 	GtkWidget *window;
-
-	g_snprintf(filename, 256, "%s/logs/%s.log", 
-		   gaim_user_dir(), normalize(name));
+	char *tmp;
+
+	tmp = gaim_user_dir();
+	g_snprintf(filename, 256, "%s/logs/%s.log", tmp, normalize(name));
+	g_free(tmp);
 
 	if ((remove(filename)) == -1) {
 		g_snprintf(buf, 256, _("Unable to remove file %s - %s"),
--- a/src/server.c	Mon Apr 16 17:04:15 2001 +0000
+++ b/src/server.c	Tue Apr 17 20:42:47 2001 +0000
@@ -657,14 +657,16 @@
 		g_snprintf(filename, 100, "%s.chat", b->name);
 
 		fd = open_log_file(filename);
-		if (!(logging_options & OPT_LOG_STRIP_HTML))
-			fprintf(fd,
-				"<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n",
-				full_date());
-		else
-			fprintf(fd, "---- New Conversation @ %s ----\n", full_date());
+		if (fd) {
+			if (!(logging_options & OPT_LOG_STRIP_HTML))
+				fprintf(fd,
+					"<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n",
+					full_date());
+			else
+				fprintf(fd, "---- New Conversation @ %s ----\n", full_date());
 
-		fclose(fd);
+			fclose(fd);
+		}
 		free(filename);
 	}