changeset 1067:649199f4730e

[gaim-migrate @ 1077] more attempts to prevent segfaults due to logging committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 04 Nov 2000 20:20:27 +0000
parents d6c70d58a4b2
children ed28707debdc
files src/conversation.c
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Sat Nov 04 11:18:59 2000 +0000
+++ b/src/conversation.c	Sat Nov 04 20:20:27 2000 +0000
@@ -1223,12 +1223,14 @@
 			else
 				g_snprintf(nm, 256, "%s", c->name);
                         fd = open_log_file(nm);
-			if (general_options & OPT_GEN_STRIP_HTML) {
-				fprintf(fd, "%s\n", t1);
-			} else {
-				fprintf(fd, "%s<BR>\n", t1);
+			if (fd > 0) {
+				if (general_options & OPT_GEN_STRIP_HTML) {
+					fprintf(fd, "%s\n", t1);
+				} else {
+					fprintf(fd, "%s<BR>\n", t1);
+				}
+				fclose(fd);
 			}
-                        fclose(fd);
                         if (general_options & OPT_GEN_STRIP_HTML) {
                                 g_free(t1);
                         }
@@ -1318,12 +1320,14 @@
                                 t2 = what;
                         }
                         fd = open_log_file(nm);
-			if (general_options & OPT_GEN_STRIP_HTML) {
-				fprintf(fd, "%s%s\n", t1, t2);
-			} else {
-				fprintf(fd, "%s%s<BR>\n", t1, t2);
+			if (fd > 0) {
+				if (general_options & OPT_GEN_STRIP_HTML) {
+					fprintf(fd, "%s%s\n", t1, t2);
+				} else {
+					fprintf(fd, "%s%s<BR>\n", t1, t2);
+				}
+				fclose(fd);
 			}
-                        fclose(fd);
                         if (general_options & OPT_GEN_STRIP_HTML) {
                                 g_free(t1);
                                 g_free(t2);