Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Wed, 03 Oct 2012 08:06:23 Commit: 57dd233e57f8297b00f6ade3fc41f047fc7e662b https://github.com/geany/geany-plugins/commit/57dd233e57f8297b00f6ade3fc41f0...
Log Message: ----------- Merge pull request #69 from b4n/alvesh88/master-fixed
Fix bug 3557458 and some compiler warnings
Modified Paths: -------------- geanypg/ChangeLog geanypg/src/encrypt_cb.c geanypg/src/helper_functions.c
Modified: geanypg/ChangeLog 6 files changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,9 @@ +2012-08-24 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Fixed bug 3557458 which caused a 0 byte to be added to the text + when encrypting a selection. + Fixed some compiler warnings. + 2012-06-04 Hans Alves <alves(dot)h88(at)gmail(dot)com>
* Fixed a bug that caused an error message to appear if one of the
Modified: geanypg/src/encrypt_cb.c 8 files changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -73,7 +73,7 @@ void geanypg_encrypt_cb(GtkMenuItem * menuitem, gpointer user_data) if (geanypg_encrypt_selection_dialog(&ed, &recp, &sign)) { int flags = 0; - int abort = 0; + int stop = 0; gpgme_key_t * key = recp; while (*key) { @@ -87,13 +87,13 @@ void geanypg_encrypt_cb(GtkMenuItem * menuitem, gpointer user_data) (*key)->uids->uid, geanypg_validity((*key)->owner_trust))) flags = GPGME_ENCRYPT_ALWAYS_TRUST; else - abort = 1; + stop = 1; } ++key; } - if (*recp && !abort) + if (*recp && !stop) geanypg_encrypt(&ed, recp, sign, flags); - else if (!abort && dialogs_show_question(_("No recipients were selected,\nuse symetric cipher?"))) + else if (!stop && dialogs_show_question(_("No recipients were selected,\nuse symetric cipher?"))) geanypg_encrypt(&ed, NULL, sign, flags); } if (recp)
Modified: geanypg/src/helper_functions.c 4 files changed, 1 insertions(+), 3 deletions(-) =================================================================== @@ -137,7 +137,7 @@ void geanypg_load_buffer(gpgme_data_t * buffer) unsigned long size = 0; if (sci_has_selection(doc->editor->sci)) { - size = scintilla_send_message(doc->editor->sci, SCI_GETSELTEXT, 0, 0); + size = scintilla_send_message(doc->editor->sci, SCI_GETSELTEXT, 0, 0) - 1; data = (char *) malloc(size + 1); scintilla_send_message(doc->editor->sci, SCI_GETSELTEXT, 0, (sptr_t)data); gpgme_data_new_from_mem(buffer, data, size, 1); @@ -157,7 +157,6 @@ void geanypg_load_buffer(gpgme_data_t * buffer) void geanypg_write_file(FILE * file) { #define BUFSIZE 2048 - unsigned long size; char buffer[BUFSIZE] = {0}; GeanyDocument * doc = document_get_current(); @@ -177,6 +176,5 @@ void geanypg_write_file(FILE * file) scintilla_send_message(doc->editor->sci, SCI_APPENDTEXT, (uptr_t) size, (sptr_t) buffer); } sci_end_undo_action(doc->editor->sci); - #undef BUFSIZE }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).