aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2002-07-25 17:51:42 +0000
committerMarcus Brinkmann <[email protected]>2002-07-25 17:51:42 +0000
commitb295bab058477187423d62a38b18e2833aaef0cc (patch)
tree8a66989f90d83abb2768dcca0ccb1b420413b00c
parent2002-07-25 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-b295bab058477187423d62a38b18e2833aaef0cc.tar.gz
gpgme-b295bab058477187423d62a38b18e2833aaef0cc.zip
2002-07-25 Marcus Brinkmann <[email protected]>
* Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and fopencookie. * vasprintf.c: Update to more recent libiberty version. * debug.h: Replace #elsif with #elif. Submitted by St�phane Corth�sy: * util.h (vasprintf): Correct prototype. * encrypt-sign.c: Include <stddef.h>. (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to size_t. * ath-pthread.c: Include <stdlib.h>, not <malloc.h>. * ath-pth.c: Likewise.
-rw-r--r--gpgme/ChangeLog15
-rw-r--r--gpgme/Makefile.am1
-rw-r--r--gpgme/ath-pth.c2
-rw-r--r--gpgme/ath-pthread.c2
-rw-r--r--gpgme/debug.h2
-rw-r--r--gpgme/encrypt-sign.c5
-rw-r--r--gpgme/util.h2
-rw-r--r--gpgme/vasprintf.c27
8 files changed, 47 insertions, 9 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog
index a23e9d17..1a920467 100644
--- a/gpgme/ChangeLog
+++ b/gpgme/ChangeLog
@@ -1,5 +1,20 @@
2002-07-25 Marcus Brinkmann <[email protected]>
+ * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
+ fopencookie.
+ * vasprintf.c: Update to more recent libiberty version.
+ * debug.h: Replace #elsif with #elif.
+
+ Submitted by St�phane Corth�sy:
+ * util.h (vasprintf): Correct prototype.
+ * encrypt-sign.c: Include <stddef.h>.
+ (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
+ size_t.
+ * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
+ * ath-pth.c: Likewise.
+
+2002-07-25 Marcus Brinkmann <[email protected]>
+
* wait.c (fdt_global): Make static. Reported by St�phane
Corth�sy.
diff --git a/gpgme/Makefile.am b/gpgme/Makefile.am
index 382e452d..6f196baa 100644
--- a/gpgme/Makefile.am
+++ b/gpgme/Makefile.am
@@ -82,6 +82,7 @@ libgpgme_la_SOURCES = \
${system_components} \
debug.c debug.h \
gpgme.c version.c errors.c
+libgpgme_la_LDADD = @LIBOBJS@
errors.c : gpgme.h
$(srcdir)/mkerrors < $(srcdir)/gpgme.h > errors.c
diff --git a/gpgme/ath-pth.c b/gpgme/ath-pth.c
index cac414c5..73c38947 100644
--- a/gpgme/ath-pth.c
+++ b/gpgme/ath-pth.c
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <malloc.h>
+#include <stdlib.h>
#include <errno.h>
#include <pth.h>
diff --git a/gpgme/ath-pthread.c b/gpgme/ath-pthread.c
index ec250d8d..6c74efd6 100644
--- a/gpgme/ath-pthread.c
+++ b/gpgme/ath-pthread.c
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <malloc.h>
+#include <stdlib.h>
#include <errno.h>
#include <pthread.h>
diff --git a/gpgme/debug.h b/gpgme/debug.h
index bdeaebcb..4bc42cfa 100644
--- a/gpgme/debug.h
+++ b/gpgme/debug.h
@@ -51,7 +51,7 @@ void _gpgme_debug_end (void **helper);
#define DEBUG_END(hlp, fmt, arg...) \
_gpgme_debug_add (&(hlp), fmt , ##arg); \
_gpgme_debug_end (&(hlp))
-#elsif 0
+#elif 0
/* Only works in C99. */
#define DEBUG0(fmt) \
_gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__))
diff --git a/gpgme/encrypt-sign.c b/gpgme/encrypt-sign.c
index e7e36d7b..60673ece 100644
--- a/gpgme/encrypt-sign.c
+++ b/gpgme/encrypt-sign.c
@@ -19,7 +19,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -34,7 +37,7 @@ static void
encrypt_sign_status_handler (GpgmeCtx ctx, GpgStatusCode code, char *args)
{
char *encrypt_info = 0;
- int encrypt_info_len;
+ size_t encrypt_info_len;
_gpgme_encrypt_status_handler (ctx, code, args);
diff --git a/gpgme/util.h b/gpgme/util.h
index d6c193cb..4213a97e 100644
--- a/gpgme/util.h
+++ b/gpgme/util.h
@@ -77,7 +77,7 @@ const char *_gpgme_get_gpgsm_path (void);
#ifdef HAVE_CONFIG_H
#if !HAVE_VASPRINTF
#include <stdarg.h>
-int vasprintf (char **result, const char *format, va_list *args);
+int vasprintf (char **result, const char *format, va_list args);
int asprintf (char **result, const char *format, ...);
#endif
diff --git a/gpgme/vasprintf.c b/gpgme/vasprintf.c
index dbef4eb0..9e39966a 100644
--- a/gpgme/vasprintf.c
+++ b/gpgme/vasprintf.c
@@ -30,8 +30,13 @@ Boston, MA 02111-1307, USA. */
int global_total_width;
#endif
-int
-vasprintf (char **result, const char *format, va_list *args)
+static int int_vasprintf (char **, const char *, va_list *);
+
+static int
+int_vasprintf (result, format, args)
+ 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
@@ -54,7 +59,7 @@ vasprintf (char **result, const char *format, va_list *args)
total_width += abs (va_arg (ap, int));
}
else
- total_width += strtoul (p, (char**)&p, 10);
+ total_width += strtoul (p, (char **) &p, 10);
if (*p == '.')
{
++p;
@@ -64,7 +69,7 @@ vasprintf (char **result, const char *format, va_list *args)
total_width += abs (va_arg (ap, int));
}
else
- total_width += strtoul (p, (char**)&p, 10);
+ total_width += strtoul (p, (char **) &p, 10);
}
while (strchr ("hlL", *p))
++p;
@@ -99,6 +104,7 @@ vasprintf (char **result, const char *format, va_list *args)
(void) va_arg (ap, char *);
break;
}
+ p++;
}
}
#ifdef TEST
@@ -111,6 +117,19 @@ vasprintf (char **result, const char *format, va_list *args)
return 0;
}
+int
+vasprintf (result, format, args)
+ char **result;
+ const char *format;
+#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
+ _BSD_VA_LIST_ args;
+#else
+ va_list args;
+#endif
+{
+ return int_vasprintf (result, format, &args);
+}
+
int
asprintf (char **buf, const char *fmt, ...)