summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <hofmann@flpsed.org>2020-11-12 08:55:49 +0100
committerJohannes Hofmann <hofmann@flpsed.org>2020-11-12 08:55:49 +0100
commit0087c49f0eb47223ddcc11364a12b484e23830ff (patch)
treee5d41f0e810ac2cc52285b8ea202fe7f57fd49dc
parent751890006285f10d7765f64ac473f8534ffe60f8 (diff)
replace strncpy, stncat with strcpy, strcat to avoid compile warningHEADmaster
gcc warns "specified bound depends on the length of the source argument". As the buffer has been allocated specifcally to hold src and destination strings there is no point in using strn* functions here. See also: https://stackoverflow.com/questions/56782248/gcc-specified-bound-depends-on-the-length-of-the-source-argument
-rw-r--r--src/PSEditText.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PSEditText.cxx b/src/PSEditText.cxx
index bfb5e27..e0729fe 100644
--- a/src/PSEditText.cxx
+++ b/src/PSEditText.cxx
@@ -41,8 +41,8 @@ void PSEditText::append_text(const char*s1) {
int len = (s?strlen(s):0) + strlen(s1) + 1;
char *tmp = (char*) malloc(len);
- strncpy(tmp, s?s:"", len);
- strncat(tmp, s1, len - strlen(tmp));
+ strcpy(tmp, s?s:"");
+ strcat(tmp, s1);
if (s) {
free(s);