ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/pack/freebsd/diff/devel/libexecinfo/libexecinfo.2007-01-31T231234Z.diff
Revision: 2
Committed: 2007-01-31T14:59:36-08:00 (18 years, 5 months ago) by douglas
Original Path: freebsd/libexecinfo.patch
File size: 1964 byte(s)
Log Message:
This needs fixing...

File Contents

# Content
1 diff -ruN /usr/ports/devel/libexecinfo/files/patch-execinfo.c ./libexecinfo/files/patch-execinfo.c
2 --- /usr/ports/devel/libexecinfo/files/patch-execinfo.c Wed Dec 31 16:00:00 1969
3 +++ ./libexecinfo/files/patch-execinfo.c Wed Feb 9 17:00:15 2005
4 @@ -0,0 +1,45 @@
5 +--- execinfo.c.orig Sun Jul 18 22:21:09 2004
6 ++++ execinfo.c Wed Feb 9 16:56:51 2005
7 +@@ -78,7 +78,6 @@
8 + rval = malloc(clen);
9 + if (rval == NULL)
10 + return NULL;
11 +- (char **)cp = &(rval[size]);
12 + for (i = 0; i < size; i++) {
13 + if (dladdr(buffer[i], &info) != 0) {
14 + if (info.dli_sname == NULL)
15 +@@ -92,14 +91,14 @@
16 + 2 + /* " <" */
17 + strlen(info.dli_sname) + /* "function" */
18 + 1 + /* "+" */
19 +- D10(offset) + /* "offset */
20 ++ 10 + /* "offset */
21 + 5 + /* "> at " */
22 + strlen(info.dli_fname) + /* "filename" */
23 + 1; /* "\0" */
24 + rval = realloc_safe(rval, clen + alen);
25 + if (rval == NULL)
26 + return NULL;
27 +- snprintf(cp, alen, "%p <%s+%d> at %s",
28 ++ snprintf((char *) rval + clen, alen, "%p <%s+%d> at %s",
29 + buffer[i], info.dli_sname, offset, info.dli_fname);
30 + } else {
31 + alen = 2 + /* "0x" */
32 +@@ -108,11 +107,14 @@
33 + rval = realloc_safe(rval, clen + alen);
34 + if (rval == NULL)
35 + return NULL;
36 +- snprintf(cp, alen, "%p", buffer[i]);
37 ++ snprintf((char *) rval + clen, alen, "%p", buffer[i]);
38 + }
39 +- rval[i] = cp;
40 +- cp += alen;
41 ++ rval[i] = (char *) clen;
42 ++ clen += alen;
43 + }
44 ++
45 ++ for (i = 0; i < size; i++)
46 ++ rval[i] += (int) rval;
47 +
48 + return rval;
49 + }