summaryrefslogtreecommitdiff
path: root/lib/appendstr.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-10-15 14:46:49 +0100
committerColin Watson <cjwatson@debian.org>2007-10-15 14:46:49 +0100
commitfd369ba030e3b438471331b668b823dc02567615 (patch)
tree96406ad1be97c599528aa1ce84a00898a53e3061 /lib/appendstr.c
parent480ba1d47a72c96cb2f835c5aaa41e11038e0b9c (diff)
remove attempts at K&R compatibility; such systems are no longer supported by the GNU build system and man-db's support for them was unadvertised and broken anyway
Diffstat (limited to 'lib/appendstr.c')
-rw-r--r--lib/appendstr.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/lib/appendstr.c b/lib/appendstr.c
index 998dc05b..1bbaebcc 100644
--- a/lib/appendstr.c
+++ b/lib/appendstr.c
@@ -20,35 +20,14 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strcpy();
-#endif /* STDC_HEADERS */
-
-#ifdef __STDC__
-# include <stdarg.h>
-# define VA_START va_start (ap, str)
-#else
-# include <varargs.h>
-# define VA_START va_start (ap)
-#endif
+#include <string.h>
+#include <stdarg.h>
#include "manconfig.h"
/* append strings to first argument, which is realloced to the correct size
first arg may be NULL */
-#ifdef __STDC__
char *appendstr (char *str, ...)
-#else
-char *appendstr (str, va_alist)
- char *str;
- va_dcl
-#endif
{
va_list ap;
int len, newlen;
@@ -56,7 +35,7 @@ char *appendstr (str, va_alist)
len = str ? strlen (str) : 0;
- VA_START;
+ va_start (ap, str);
newlen = len + 1;
while ((next = va_arg (ap, char *)))
newlen += strlen (next);
@@ -65,7 +44,7 @@ char *appendstr (str, va_alist)
str = xrealloc (str, newlen);
end = str + len;
- VA_START;
+ va_start (ap, str);
while ((next = va_arg (ap, char *))) {
strcpy (end, next);
end += strlen (next);