[geany/geany] 874c82: Export: don't include unused, random styles

Colomban Wendling git-noreply at xxxxx
Wed Apr 9 16:07:30 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Wed, 09 Apr 2014 16:07:30 UTC
Commit:      874c822328ed046cb15b4fe2d3dc7839eeac2b94
             https://github.com/geany/geany/commit/874c822328ed046cb15b4fe2d3dc7839eeac2b94

Log Message:
-----------
Export: don't include unused, random styles

Fix the bounds checking on included styles only to check for inclusion
actually defined styles, not to include random styles based on
uninitialized array indices.


Modified Paths:
--------------
    plugins/export.c

Modified: plugins/export.c
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -544,7 +544,7 @@ static void write_latex_file(GeanyDocument *doc, const gchar *filename,
 
 	/* write used styles in the header */
 	cmds = g_string_new("");
-	for (i = 0; i <= STYLE_MAX; i++)
+	for (i = 0; i < style_max; i++)
 	{
 		if (styles[i][USED])
 		{
@@ -737,7 +737,7 @@ static void write_html_file(GeanyDocument *doc, const gchar *filename,
 	"\tbody\n\t{\n\t\tfont-family: %s, monospace;\n\t\tfont-size: %dpt;\n\t}\n",
 				font_name, font_size);
 
-	for (i = 0; i <= STYLE_MAX; i++)
+	for (i = 0; i < style_max; i++)
 	{
 		if (styles[i][USED])
 		{



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list