From 3faf11925549260c3822660a2b83785a68326664 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 12 Jun 2023 15:44:03 +0200 Subject: yat2m: Fix Windows build * doc/yat2m.c (mystpcpy): New. Use instead of stpcpy. -- Fixes-commit: 43dcdbff50fa33728ab4717cacdf8ff600aea3b9 --- doc/yat2m.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/yat2m.c b/doc/yat2m.c index 0e368fc..15f7f76 100644 --- a/doc/yat2m.c +++ b/doc/yat2m.c @@ -396,6 +396,17 @@ xstrdup (const char *string) return p; } +static char * +mystpcpy (char *a,const char *b) +{ + while( *b ) + *a++ = *b++; + *a = 0; + + return (char*)a; +} + + /* Helper for xstrconcat and strconcat. */ static char * do_strconcat (int xmode, const char *s1, va_list arg_ptr) @@ -418,7 +429,7 @@ do_strconcat (int xmode, const char *s1, va_list arg_ptr) needed++; buffer = xmode? xmalloc (needed) : malloc (needed); for (p = buffer, argc=0; argv[argc]; argc++) - p = stpcpy (p, argv[argc]); + p = mystpcpy (p, argv[argc]); return buffer; } -- cgit v1.2.3