[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-155-gdf27a8bc0
wwp at claws-mail.org
wwp at claws-mail.org
Sat Sep 11 22:38:08 CEST 2021
The branch, gtk3 has been updated
via df27a8bc02e429754a8b593a660c4b3ba8bfcd32 (commit)
from 69e7131dc87ed1dbec2f9140a03b38feaf192cdf (commit)
Summary of changes:
src/action.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
- Log -----------------------------------------------------------------
commit df27a8bc02e429754a8b593a660c4b3ba8bfcd32
Author: wwp <subscript at free.fr>
Date: Sat Sep 11 22:37:57 2021 +0200
Revert "Fix CID 1491207, 1491213 and 1491253: ensure string in buffer is 0-ended,"
This reverts commit 74059cdc111cdc7ada818eb3a57df6f441acdbe5.
diff --git a/src/action.c b/src/action.c
index c04507d9c..411df0600 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1042,13 +1042,11 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str,
int r;
ret_str = g_locale_from_utf8(msg_str, strlen(msg_str),
&by_read, &by_written, NULL);
- if (ret_str && by_written)
+ if (ret_str && by_written) {
r = write(chld_in, ret_str, strlen(ret_str));
- else
- r = write(chld_in, msg_str, strlen(msg_str));
- if (ret_str)
g_free(ret_str);
-
+ } else
+ r = write(chld_in, msg_str, strlen(msg_str));
if (!(children->action_type &
(ACTION_USER_IN | ACTION_USER_HIDDEN_IN)))
r = close(chld_in);
@@ -1578,15 +1576,15 @@ static void catch_output(gpointer data, gint source, GIOCondition cond)
if (c == 0)
break;
- buf[c] = 0;
ret_str = g_locale_to_utf8
- (buf, c, &bytes_read, &bytes_written, NULL);
- if (ret_str && bytes_written > 0)
- gtk_text_buffer_insert(textbuf, &iter, ret_str, -1);
- else
- gtk_text_buffer_insert(textbuf, &iter, buf, c);
- if (ret_str)
+ (buf, c - 1, &bytes_read, &bytes_written, NULL);
+ if (ret_str && bytes_written > 0) {
+ gtk_text_buffer_insert
+ (textbuf, &iter, ret_str,
+ -1);
g_free(ret_str);
+ } else
+ gtk_text_buffer_insert(textbuf, &iter, buf, c - 1);
}
if (child_info->children->is_selection) {
@@ -1602,7 +1600,6 @@ static void catch_output(gpointer data, gint source, GIOCondition cond)
gsize bytes_read = 0, bytes_written = 0;
gchar *ret_str;
- buf[c] = 0;
ret_str = g_locale_to_utf8
(buf, c, &bytes_read, &bytes_written, NULL);
if (ret_str && bytes_written > 0) {
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list