From 8e34a14fe694a8c765973aaa3a8b2a2d2c3ba8b9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 18 Apr 2018 20:11:27 +0200 Subject: [PATCH] json: Add stpcpy replacement. * src/gpgme-json.c [!HAVE_STPCPY](_my_stpcpy): New. Signed-off-by: Werner Koch --- src/gpgme-json.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gpgme-json.c b/src/gpgme-json.c index 0beb78f4..f1e9f256 100644 --- a/src/gpgme-json.c +++ b/src/gpgme-json.c @@ -114,6 +114,19 @@ static struct #define spacep(p) (*(p) == ' ' || *(p) == '\t') +#ifndef HAVE_STPCPY +static GPGRT_INLINE char * +_my_stpcpy (char *a, const char *b) +{ + while (*b) + *a++ = *b++; + *a = 0; + return a; +} +#define stpcpy(a,b) _my_stpcpy ((a), (b)) +#endif /*!HAVE_STPCPY*/ + + static void xoutofcore (const char *type)