[balsa] print-object-text: use structure assignment



commit 51125b9ae365742ad8f6b619fb35ddae7f891453
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Feb 18 18:26:26 2019 -0500

    print-object-text: use structure assignment
    
    * src/balsa-print-object-text.c (collect_attrs): initialize a
      region by structure assignment instead of g_memdup().

 ChangeLog                     | 6 ++++++
 src/balsa-print-object-text.c | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5f1246cf0..e4a1bd498 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * src/balsa-print-object-text.c (collect_attrs): initialize a
+       region by structure assignment instead of g_memdup().
+
+
 2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * libbalsa/send.c (libbalsa_message_create_mime_message): do not
diff --git a/src/balsa-print-object-text.c b/src/balsa-print-object-text.c
index 397bc5d1f..47e98a8b9 100644
--- a/src/balsa-print-object-text.c
+++ b/src/balsa-print-object-text.c
@@ -924,8 +924,10 @@ collect_attrs(GList * all_attr, guint offset, guint len)
             && region->start_index <= offset + len)
            || (region->end_index >= offset
                && region->end_index <= offset + len)) {
-           PhraseRegion *this_reg =
-               g_memdup(region, sizeof(PhraseRegion));
+           PhraseRegion *this_reg;
+
+           this_reg = g_new(PhraseRegion, 1);
+            *this_reg = *region;
 
            if (this_reg->start_index < offset)
                this_reg->start_index = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]