src/gtkprefs.c

changeset 7079
ba826f90507f
parent 6982
12f08de92674
child 7092
9c3614180830
--- a/src/gtkprefs.c	Tue Sep 30 18:41:28 2003 +0000
+++ b/src/gtkprefs.c	Tue Sep 30 20:13:22 2003 +0000
@@ -2662,19 +2662,16 @@
 
 void apply_font_dlg(GtkWidget *w, GtkWidget *f)
 {
-	char *fontname, *c;
+	char *fontname, *space;
 
 	fontname =
 		gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f));
 
 	destroy_fontsel(0, 0);
 
-	for (c = fontname; *c != '\0'; c++) {
-		if (isdigit(*c)) {
-			*(--c) = '\0';
-			break;
-		}
-	}
+	space = strrchr(fontname, ' ');
+	if(space && isdigit(*(space+1)))
+		*space = '\0';
 
 	gaim_prefs_set_string("/gaim/gtk/conversations/font_face", fontname);
 

mercurial