[geany/geany] 1e1032: Make save actions use something bigger than a pointer for a buffer

elextr git-noreply at xxxxx
Thu May 2 07:51:12 UTC 2013


Branch:      refs/heads/master
Author:      elextr <elextr at gmail.com>
Committer:   elextr <elextr at gmail.com>
Date:        Thu, 02 May 2013 07:51:12 UTC
Commit:      1e1032505d16a26d018a66908bef54c8e899c4bb
             https://github.com/geany/geany/commit/1e1032505d16a26d018a66908bef54c8e899c4bb

Log Message:
-----------
Make save actions use something bigger than a pointer for a buffer

At commit 160e5e stamp was changed from a gchar[512] to a gchar*
but the copy loop still used stamp and sizeof(stamp) as the buffer.
Now gchar[512] buffer is used again.


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

Modified: plugins/saveactions.c
5 files changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -191,6 +191,7 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
 	gchar *basename_src;
 	gchar *dir_parts_src;
 	gchar *stamp;
+	gchar buf[512];
 
 	if (! enable_backupcopy)
 		return;
@@ -227,9 +228,9 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
 		return;
 	}
 
-	while (fgets(stamp, sizeof(stamp), src) != NULL)
+	while (fgets(buf, sizeof(buf), src) != NULL)
 	{
-		fputs(stamp, dst);
+		fputs(buf, dst);
 	}
 
 	fclose(src);



--------------
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