FreeBSD Bugzilla – Attachment 145837 Details for
Bug 191428
net/libbgpdump misbehaves when compiled with clang
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
use snprintf instead of buggy included int2str, revert back to system compiler
patch-libbgpdump-util.c (text/plain), 1.34 KB, created by
mjl
on 2014-08-15 20:16:03 UTC
(
hide
)
Description:
use snprintf instead of buggy included int2str, revert back to system compiler
Filename:
MIME Type:
Creator:
mjl
Created:
2014-08-15 20:16:03 UTC
Size:
1.34 KB
patch
obsolete
>diff -uNr libbgpdump.orig/Makefile libbgpdump/Makefile >--- libbgpdump.orig/Makefile 2014-07-24 20:50:02.000000000 -0700 >+++ libbgpdump/Makefile 2014-08-15 12:57:08.000000000 -0700 >@@ -3,7 +3,7 @@ > > 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 +15,6 @@ > > GNU_CONFIGURE= yes > USE_LDCONFIG= yes >-USE_GCC= any > > OPTIONS_DEFINE= DOCS EXAMPLES > >diff -uNr libbgpdump.orig/files/patch-util.c libbgpdump/files/patch-util.c >--- libbgpdump.orig/files/patch-util.c 1969-12-31 16:00:00.000000000 -0800 >+++ libbgpdump/files/patch-util.c 2014-08-15 13:01:55.000000000 -0700 >@@ -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 <syslog.h> >+ #include <time.h> >+ #include <string.h> >++#include <inttypes.h> >+ >+ 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) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 191428
:
144179
| 145837