Skip to content

Commit

Permalink
Make save actions use something bigger than a pointer for a buffer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elextr committed May 2, 2013
1 parent 5c37ca8 commit 1e10325
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/saveactions.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1e10325

Please sign in to comment.