From bbe0472a0d760bc147106f43e3630e9c9c5c8431 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 30 Mar 2011 12:20:18 +0000 Subject: [PATCH] Use STYLE_MAX instead of 127 for editor_set_font(). This fixes a crash in the Split Window plugin when changing filetype (patch by Matthew Brush, thanks; fixes #3255968). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5653 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 8 ++++++++ src/editor.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e14e2228..83bd02c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-03-30 Nick Treleaven + + * src/editor.c: + Use STYLE_MAX instead of 127 for editor_set_font(). This fixes a + crash in the Split Window plugin when changing filetype (patch by + Matthew Brush, thanks; fixes #3255968). + + 2011-03-30 Colomban Wendling * src/plugindata.h, src/pluginprivate.h, src/plugins.c, diff --git a/src/editor.c b/src/editor.c index c093e9c8..410cfd3b 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4478,7 +4478,7 @@ void editor_set_font(GeanyEditor *editor, const gchar *font) font_name = g_strdup_printf("!%s", pango_font_description_get_family(pfd)); pango_font_description_free(pfd); - for (style = 0; style <= 127; style++) + for (style = 0; style <= STYLE_MAX; style++) sci_set_font(editor->sci, style, font_name, size); /* line number and braces */