Revision: 2744 http://geany.svn.sourceforge.net/geany/?rev=2744&view=rev Author: eht16 Date: 2008-07-03 05:51:14 -0700 (Thu, 03 Jul 2008)
Log Message: ----------- Fix broken session file support with more than 99 files (closes #2007288).
Modified Paths: -------------- trunk/ChangeLog trunk/src/keyfile.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-07-03 12:32:55 UTC (rev 2743) +++ trunk/ChangeLog 2008-07-03 12:51:14 UTC (rev 2744) @@ -3,6 +3,9 @@ * src/utils.c: Fix unnecessary 40 character limit for auto-closing XML tags (closes #2007278). + * src/keyfile.c: + Fix broken session file support with more than 99 files + (closes #2007288).
2008-07-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2008-07-03 12:32:55 UTC (rev 2743) +++ trunk/src/keyfile.c 2008-07-03 12:51:14 UTC (rev 2744) @@ -160,7 +160,7 @@ { gint npage; gchar *tmp; - gchar entry[14]; + gchar entry[16]; guint i = 0, j = 0, max; GeanyDocument *doc;
@@ -176,7 +176,7 @@ { gchar *fname;
- g_snprintf(entry, 13, "FILE_NAME_%d", j); + g_snprintf(entry, sizeof(entry), "FILE_NAME_%d", j); fname = get_session_file_string(doc); g_key_file_set_string(config, "files", entry, fname); g_free(fname); @@ -187,7 +187,7 @@ i = j; while (TRUE) { - g_snprintf(entry, 13, "FILE_NAME_%d", i); + g_snprintf(entry, sizeof(entry), "FILE_NAME_%d", i); tmp = g_key_file_get_string(config, "files", entry, NULL); if (tmp == NULL) { @@ -466,7 +466,7 @@ guint i; gsize len = 0; gboolean have_session_files; - gchar entry[14]; + gchar entry[16]; gchar **tmp_array; GError *error = NULL;
@@ -492,7 +492,7 @@ i = 0; while (have_session_files) { - g_snprintf(entry, 13, "FILE_NAME_%d", i); + g_snprintf(entry, sizeof(entry), "FILE_NAME_%d", i); tmp_array = g_key_file_get_string_list(config, "files", entry, NULL, &error); if (! tmp_array || error) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.