You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/logrotate/files/logrotate-3.11.0-noasprintf...

56 lines
1.2 KiB

diff -Nuar a/config.c b/config.c
--- a/config.c 2016-12-02 23:36:15.568906130 +0100
+++ b/config.c 2016-12-02 23:41:17.438907108 +0100
@@ -49,39 +49,6 @@
#include "asprintf.c"
#endif
-#if !defined(HAVE_ASPRINTF) && !defined(_FORTIFY_SOURCE)
-#include <stdarg.h>
-
-int asprintf(char **string_ptr, const char *format, ...)
-{
- va_list arg;
- char *str;
- int size;
- int rv;
-
- va_start(arg, format);
- size = vsnprintf(NULL, 0, format, arg);
- size++;
- va_start(arg, format);
- str = malloc(size);
- if (str == NULL) {
- va_end(arg);
- /*
- * Strictly speaking, GNU asprintf doesn't do this,
- * but the caller isn't checking the return value.
- */
- fprintf(stderr, "failed to allocate memory\\n");
- exit(1);
- }
- rv = vsnprintf(str, size, format, arg);
- va_end(arg);
-
- *string_ptr = str;
- return (rv);
-}
-
-#endif
-
#if !defined(HAVE_STRNDUP)
char *strndup(const char *s, size_t n)
{
diff -Nuar a/logrotate.h b/logrotate.h
--- a/logrotate.h 2016-11-30 13:05:55.000000000 +0100
+++ b/logrotate.h 2016-12-02 23:40:54.518907034 +0100
@@ -82,8 +82,5 @@
extern int debug;
int readAllConfigPaths(const char **paths);
-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
-int asprintf(char **string_ptr, const char *format, ...);
-#endif
#endif