[git] GpgOL - branch, master, updated. gpgol-1.2.0-106-gb4ce4fd

by Andre Heinecke cvs at cvs.gnupg.org
Fri Nov 13 17:20:12 CET 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  b4ce4fdf509c7223e605770610d38611483572e1 (commit)
       via  1b664e0d4a74c8b8daeafa9fe1fe82af488c141d (commit)
      from  f620398facc12abb8772e32c010e27658a0422ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b4ce4fdf509c7223e605770610d38611483572e1
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Nov 13 17:18:28 2015 +0100

    Use gpgrt_asprintf
    
    * src/attachment.cpp (do_crypt), src/gpgoladdin.cpp (GetCustomUI):
      Use gpgrt_asprintf.
    
    --
    We link libgpg-error anyway so let's make use of it. Fixes
    the build on debian wheezy

diff --git a/src/attachment.cpp b/src/attachment.cpp
index 66588d5..2043658 100644
--- a/src/attachment.cpp
+++ b/src/attachment.cpp
@@ -27,6 +27,7 @@
 #include "mapihelp.h"
 
 #include <objidlbase.h>
+#include <gpg-error.h>
 
 #define COPYBUFFERSIZE 4096
 
@@ -280,7 +281,7 @@ do_crypt (LPDISPATCH mailitem, bool protect)
       LPATTACH mapi_attachment;
       attachtype_t att_type;
 
-      if (asprintf (&item_str, "Item(%i)", i) == -1)
+      if (gpgrt_asprintf (&item_str, "Item(%i)", i) == -1)
         {
           log_error ("%s:%s: Error: %i", SRCNAME, __func__, __LINE__);
           goto done;
diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index 8b03782..269c2af 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -50,6 +50,8 @@
 #include "windowmessages.h"
 #include "mail.h"
 
+#include <gpg-error.h>
+
 #define ICON_SIZE_LARGE  32
 #define ICON_SIZE_NORMAL 16
 
@@ -598,7 +600,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
 
   if (!wcscmp (RibbonID, L"Microsoft.Outlook.Mail.Compose"))
     {
-      asprintf (&buffer,
+      gpgrt_asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
         "   <tabs>"
@@ -712,7 +714,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
   if (!wcscmp (RibbonID, L"Microsoft.Outlook.Mail.Compose"))
     {
       TRACEPOINT
-      asprintf (&buffer,
+      gpgrt_asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
         "   <tabs>"
@@ -805,7 +807,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
   else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Mail.Read"))
     {
       TRACEPOINT
-      asprintf (&buffer,
+      gpgrt_asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
         "   <tabs>"
@@ -879,7 +881,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
   else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Explorer"))
     {
       TRACEPOINT
-      asprintf (&buffer,
+      gpgrt_asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
         "   <tabs>"

commit 1b664e0d4a74c8b8daeafa9fe1fe82af488c141d
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Nov 13 17:17:38 2015 +0100

    Remove unsed vasprintf implementation
    
    * src/missing/vasprintf.c: Removed.
    
    --
    This didn't compile anymore with gcc-4.9

diff --git a/src/missing/vasprintf.c b/src/missing/vasprintf.c
deleted file mode 100644
index 6adff11..0000000
--- a/src/missing/vasprintf.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Like vsprintf but provides a pointer to malloc'd storage, which must
-   be freed by the caller.
-   Copyright (C) 1994, 2002 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#ifdef TEST
-int global_total_width;
-#endif
-
-int
-vasprintf (char **result, const char *format, va_list *args)
-{
-  const char *p = format;
-  /* Add one to make sure that it is never zero, which might cause malloc
-     to return NULL.  */
-  int total_width = strlen (format) + 1;
-  va_list ap;
-
-#ifdef va_copy
-  va_copy (ap, args);
-#else
-#ifdef __va_copy
-  __va_copy (ap, args);
-#else
-  memcpy (&ap, args, sizeof (va_list));
-#endif /* __va_copy */
-#endif /* va_copy */
-
-  while (*p != '\0')
-    {
-      if (*p++ == '%')
-	{
-	  while (strchr ("-+ #0", *p))
-	    ++p;
-	  if (*p == '*')
-	    {
-	      ++p;
-	      total_width += abs (va_arg (ap, int));
-	    }
-	  else
-	    total_width += strtoul (p, (char**)&p, 10);
-	  if (*p == '.')
-	    {
-	      ++p;
-	      if (*p == '*')
-		{
-		  ++p;
-		  total_width += abs (va_arg (ap, int));
-		}
-	      else
-	      total_width += strtoul (p, (char**)&p, 10);
-	    }
-	  while (strchr ("hlL", *p))
-	    ++p;
-	  /* Should be big enough for any format specifier except %s
-             and floats.  */
-	  total_width += 30;
-	  switch (*p)
-	    {
-	    case 'd':
-	    case 'i':
-	    case 'o':
-	    case 'u':
-	    case 'x':
-	    case 'X':
-	    case 'c':
-	      (void) va_arg (ap, int);
-	      break;
-	    case 'f':
-	    case 'e':
-	    case 'E':
-	    case 'g':
-	    case 'G':
-	      (void) va_arg (ap, double);
-	      /* Since an ieee double can have an exponent of 307, we'll
-		 make the buffer wide enough to cover the gross case. */
-	      total_width += 307;
-	      break;
-	    case 's':
-              {
-                char *tmp = va_arg (ap, char *);
-                if (tmp)
-                  total_width += strlen (tmp);
-                else /* in case the vsprintf does prints a text */
-                  total_width += 25; /* e.g. "(null pointer reference)" */
-              }
-	      break;
-	    case 'p':
-	    case 'n':
-	      (void) va_arg (ap, char *);
-	      break;
-	    }
-	}
-    }
-#ifdef TEST
-  global_total_width = total_width;
-#endif
-  *result = malloc (total_width);
-  if (*result != NULL)
-    return vsprintf (*result, format, *args);
-  else
-    return 0;
-}
-
-
-int
-asprintf (char **buf, const char *fmt, ...)
-{
-  int status;
-  va_list ap;
-
-  va_start (ap, fmt);
-  status = vasprintf (buf, fmt, ap);
-  va_end (ap);
-  return status;
-}
-
-
-#ifdef TEST
-void
-checkit (const char* format, ...)
-{
-  va_list args;
-  char *result;
-
-  va_start (args, format);
-  vasprintf (&result, format, args);
-  if (strlen (result) < global_total_width)
-    printf ("PASS: ");
-  else
-    printf ("FAIL: ");
-  printf ("%d %s\n", global_total_width, result);
-}
-
-int
-main (void)
-{
-  checkit ("%d", 0x12345678);
-  checkit ("%200d", 5);
-  checkit ("%.300d", 6);
-  checkit ("%100.150d", 7);
-  checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
-777777777777777777333333333333366666666666622222222222777777777777733333");
-  checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
-}
-#endif /* TEST */

-----------------------------------------------------------------------

Summary of changes:
 src/attachment.cpp      |   3 +-
 src/gpgoladdin.cpp      |  10 +--
 src/missing/vasprintf.c | 169 ------------------------------------------------
 3 files changed, 8 insertions(+), 174 deletions(-)
 delete mode 100644 src/missing/vasprintf.c


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list