From c6e3cec631a3215af263d7e4ac731c4b40ba1bda Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Sat, 2 Jun 2001 11:23:26 +0000 Subject: - Unbroke with threaded Mesa libraries (XFree86-4); - provide workaround for sscanf(3) bug in 5-CURRENT, that causes SIGBUS. --- net/xtraceroute/files/patch-util.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 net/xtraceroute/files/patch-util.c (limited to 'net/xtraceroute/files/patch-util.c') diff --git a/net/xtraceroute/files/patch-util.c b/net/xtraceroute/files/patch-util.c new file mode 100644 index 000000000000..ecf92fab3ea9 --- /dev/null +++ b/net/xtraceroute/files/patch-util.c @@ -0,0 +1,27 @@ +Workaround for a sscanf(3) bug in the FreeBSD 5-CURRENT. + +$FreeBSD$ + +--- util.c 2001/06/02 10:41:42 1.1 ++++ util.c 2001/06/02 11:14:20 +@@ -36,10 +36,19 @@ + double loc = 0; + float sub; + int i = 0; ++ int len; ++ char *tmp; ++ ++ len = strlen(str); ++ if (str[len - 1] == 'e') { ++ tmp = alloca(len); ++ strlcpy(tmp, str, len); ++ } else ++ tmp = str; + + while(1) + { +- sscanf(&str[i], "%f", &sub); ++ sscanf(&tmp[i], "%f", &sub); + loc += sub*factor; + + // Skip all spaces and tabs -- cgit v1.2.3