From fdff402b8c264d6abcca46c1ae544667f5b9a93b Mon Sep 17 00:00:00 2001 From: Kurt Jaeger Date: Fri, 15 Aug 2014 20:24:06 +0000 Subject: [PATCH] net/libbgpdump: fix build with clang PR: 191428 Submitted by: mjl@luckie.org.nz (maintainer) --- net/libbgpdump/Makefile | 4 +--- net/libbgpdump/files/patch-util.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 net/libbgpdump/files/patch-util.c diff --git a/net/libbgpdump/Makefile b/net/libbgpdump/Makefile index 980982bb59c4..d8758bde4378 100644 --- a/net/libbgpdump/Makefile +++ b/net/libbgpdump/Makefile @@ -1,9 +1,8 @@ -# Created by: ijliao # $FreeBSD$ PORTNAME= libbgpdump PORTVERSION= 1.4.99.13 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net MASTER_SITES= http://www.ris.ripe.net/source/bgpdump/ EXTRACT_SUFX= .tgz @@ -15,7 +14,6 @@ LICENSE= GPLv2 GNU_CONFIGURE= yes USE_LDCONFIG= yes -USE_GCC= any OPTIONS_DEFINE= DOCS EXAMPLES diff --git a/net/libbgpdump/files/patch-util.c b/net/libbgpdump/files/patch-util.c new file mode 100644 index 000000000000..c883c93f39ca --- /dev/null +++ b/net/libbgpdump/files/patch-util.c @@ -0,0 +1,29 @@ +--- util.c.orig 2014-08-15 12:58:56.000000000 -0700 ++++ util.c 2014-08-15 13:01:14.000000000 -0700 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + static bool use_syslog = true; + +@@ -110,17 +111,7 @@ + + int int2str(uint32_t value, char* str) + { +- const int LEN = 11; +- char b[LEN]; +- int i = LEN; +- b[i--] = '\0'; +- +- do { +- b[i--] = (char)(48 + (value % 10)); +- } while (value /= 10); +- +- memcpy(str, b + i + 1, LEN - i); +- return LEN - i - 1; ++ return snprintf(str, 11, "%"PRIu32, value); + } + + static void ti2s(uint32_t value) {