1 |
dirtyepic 09/08/01 05:10:04 |
2 |
|
3 |
Added: mpc-0.6-fortify.patch |
4 |
Log: |
5 |
Move into main tree |
6 |
(Portage version: 2.2_rc33/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 dev-libs/mpc/files/mpc-0.6-fortify.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/mpc/files/mpc-0.6-fortify.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/mpc/files/mpc-0.6-fortify.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: mpc-0.6-fortify.patch |
15 |
=================================================================== |
16 |
Fix testsuite failure w/ -D_FORTIFY_SOURCE=2 |
17 |
http://lists.gforge.inria.fr/pipermail/mpc-discuss/2009-April/000404.html |
18 |
|
19 |
--- mpc-0.6-orig/src/inp_str.c |
20 |
+++ mpc-0.6/src/inp_str.c |
21 |
@@ -1,6 +1,6 @@ |
22 |
/* mpc_inp_str -- Input a complex number from a given stream. |
23 |
|
24 |
-Copyright (C) 2009 Andreas Enge, Philippe Th\'eveny, Paul Zimmermann. |
25 |
+Copyright (C) 2009 Andreas Enge, Philippe Th\'eveny, Paul Zimmermann |
26 |
|
27 |
This file is part of the MPC Library. |
28 |
|
29 |
@@ -80,6 +80,7 @@ extract_string (FILE *stream) |
30 |
size_t nread = 0; |
31 |
size_t strsize = 100; |
32 |
char *str = mpc_alloc_str (strsize); |
33 |
+ size_t lenstr; |
34 |
|
35 |
c = getc (stream); |
36 |
while (c != EOF && c != '\n' |
37 |
@@ -101,6 +102,8 @@ extract_string (FILE *stream) |
38 |
if (nread == 0) |
39 |
return str; |
40 |
|
41 |
+ lenstr = nread; |
42 |
+ |
43 |
if (c == '(') { |
44 |
size_t n; |
45 |
char *suffix; |
46 |
@@ -127,7 +130,7 @@ extract_string (FILE *stream) |
47 |
strsize = nread + 1; |
48 |
} |
49 |
|
50 |
- n = sprintf (str, "%s(%s", str, suffix); |
51 |
+ n = lenstr + sprintf (str + lenstr, "(%s", suffix); |
52 |
MPC_ASSERT (n == nread); |
53 |
|
54 |
c = getc (stream); |
55 |
@@ -151,7 +154,9 @@ extract_string (FILE *stream) |
56 |
|
57 |
|
58 |
int |
59 |
-mpc_inp_str (mpc_ptr rop, FILE *stream, size_t *read, int base, mpc_rnd_t rnd_mode) { |
60 |
+mpc_inp_str (mpc_ptr rop, FILE *stream, size_t *read, int base, |
61 |
+mpc_rnd_t rnd_mode) |
62 |
+{ |
63 |
size_t white, nread = 0; |
64 |
int inex = -1; |
65 |
int c; |