| 1 |
Description: Fix stringop-truncation warnings |
| 2 |
Author: Peter Blackman <[email protected]> |
| 3 |
Forwarded: not-needed |
| 4 |
|
| 5 |
Index: b/flam3-genome.c |
| 6 |
=================================================================== |
| 7 |
--- a/flam3-genome.c |
| 8 |
+++ b/flam3-genome.c |
| 9 |
@@ -977,7 +977,7 @@ |
| 10 |
|
| 11 |
if (cp_orig.flame_name[0]) { |
| 12 |
char tm[flam3_name_len+1]; |
| 13 |
- strncpy(tm, cp_orig.flame_name, flam3_name_len); |
| 14 |
+ strncpy(tm, cp_orig.flame_name, flam3_name_len+1); |
| 15 |
snprintf(cp_orig.flame_name, flam3_name_len, "mutation %d of %s", rep, tm); |
| 16 |
} |
| 17 |
|
| 18 |
Index: b/flam3.c |
| 19 |
=================================================================== |
| 20 |
--- a/flam3.c |
| 21 |
+++ b/flam3.c |
| 22 |
@@ -2505,7 +2505,7 @@ |
| 23 |
f->rc.randrsl[lp] = default_isaac_seed; |
| 24 |
} else { |
| 25 |
/* Use the specified string */ |
| 26 |
- strncpy((char *)&f->rc.randrsl,(const char *)isaac_seed, RANDSIZ*sizeof(ub4)); |
| 27 |
+ strncpy((char *)&f->rc.randrsl,(const char *)isaac_seed, RANDSIZ*sizeof(ub4)-1); |
| 28 |
} |
| 29 |
|
| 30 |
/* Initialize the random number generator */ |