Contents of /trunk/qhull/patches/qhull-2010.1-overflows.patch
Parent Directory | Revision Log
Revision 1449 -
(show annotations)
(download)
Wed Jul 27 21:43:46 2011 UTC (13 years, 2 months ago) by niro
File size: 1884 byte(s)
Wed Jul 27 21:43:46 2011 UTC (13 years, 2 months ago) by niro
File size: 1884 byte(s)
-added qhull patches from gentoo
1 | From 176c01851026125f574a8223ad49ec58b2b58ec0 Mon Sep 17 00:00:00 2001 |
2 | From: Johannes Obermayr <johannesobermayr@gmx.de> |
3 | Date: Fri, 23 Jul 2010 20:02:19 +0200 |
4 | Subject: [PATCH] Fix some serious compiler warnings causing build breakage on openSUSE. |
5 | |
6 | --- |
7 | src/global.c | 2 +- |
8 | src/rboxlib.c | 6 +++--- |
9 | 2 files changed, 4 insertions(+), 4 deletions(-) |
10 | |
11 | diff --git a/src/global.c b/src/global.c |
12 | index 3c6141a..4c9f56c 100644 |
13 | --- a/src/global.c |
14 | +++ b/src/global.c |
15 | @@ -614,7 +614,7 @@ void qh_initflags(char *command) { |
16 | if (command <= &qh qhull_command[0] || command > &qh qhull_command[0] + sizeof(qh qhull_command)) { |
17 | if (command != &qh qhull_command[0]) { |
18 | *qh qhull_command= '\0'; |
19 | - strncat( qh qhull_command, command, sizeof( qh qhull_command)); |
20 | + strncat(qh qhull_command, command, sizeof(qh qhull_command)-strlen(qh qhull_command)-1); |
21 | } |
22 | while (*s && !isspace(*s)) /* skip program name */ |
23 | s++; |
24 | diff --git a/src/rboxlib.c b/src/rboxlib.c |
25 | index 4f11d22..17d01ac 100644 |
26 | --- a/src/rboxlib.c |
27 | +++ b/src/rboxlib.c |
28 | @@ -124,7 +124,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { |
29 | } |
30 | |
31 | *command= '\0'; |
32 | - strncat(command, rbox_command, sizeof(command)); |
33 | + strncat(command, rbox_command, sizeof(command)-strlen(command)-1); |
34 | |
35 | while (*s && !isspace(*s)) /* skip program name */ |
36 | s++; |
37 | @@ -346,8 +346,8 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { |
38 | } |
39 | }else if (israndom) { |
40 | seed= (int)time(&timedata); |
41 | - sprintf(seedbuf, " t%d", seed); /* appends an extra t, not worth removing */ |
42 | - strncat(command, seedbuf, sizeof(command)); |
43 | + printf(seedbuf, " t%d", seed); /* appends an extra t, not worth removing */ |
44 | + strncat(command, seedbuf, sizeof(command)-strlen(command)-1); |
45 | t= strstr(command, " t "); |
46 | if (t) |
47 | strcpy(t+1, t+3); /* remove " t " */ |
48 | -- |
49 | 1.6.1 |
50 |