CoinMP: fix build w/ gcc-9.1.0
Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
parent
cec37dc259
commit
9b47bc19c8
1 changed files with 19 additions and 0 deletions
19
srcpkgs/CoinMP/patches/fix-gcc9.1-strncpy.patch
Normal file
19
srcpkgs/CoinMP/patches/fix-gcc9.1-strncpy.patch
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--- CoinMP/src/CoinProblem.c 2011-11-03 04:43:29.000000000 +0100
|
||||||
|
+++ CoinMP/src/CoinProblem.c 2019-05-20 12:06:36.762510299 +0200
|
||||||
|
@@ -126,14 +126,8 @@
|
||||||
|
|
||||||
|
void coinSetProblemName(PPROBLEM pProblem, const char *ProblemName)
|
||||||
|
{
|
||||||
|
- size_t len;
|
||||||
|
-
|
||||||
|
- len = strlen(ProblemName);
|
||||||
|
- if (len >= sizeof(pProblem->ProblemName)) {
|
||||||
|
- len = sizeof(pProblem->ProblemName) - 1;
|
||||||
|
- }
|
||||||
|
- strncpy(pProblem->ProblemName, ProblemName, len);
|
||||||
|
- pProblem->ProblemName[len] = '\0';
|
||||||
|
+ snprintf(pProblem->ProblemName, sizeof(pProblem->ProblemName), "%s", ProblemName);
|
||||||
|
+ pProblem->ProblemName[sizeof(pProblem->ProblemName) - 1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue