Skip to content

Commit

Permalink
silence -Werror=stringop-truncation
Browse files Browse the repository at this point in the history
i.e. output truncated before terminating nul copying as many bytes from a string as its length
  • Loading branch information
Caolán McNamara committed Aug 21, 2022
1 parent 8f126c3 commit c0b78f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ int MyThes::Lookup(const char * pText, int len, mentry** pme)
int k = strlen(pos);
int m = strlen(pm->psyns[0]);
if ((k+m) < (MAX_WD_LEN - 1)) {
strncpy(dfn,pos,k);
memcpy(dfn,pos,k);
*(dfn+k) = ' ';
strncpy((dfn+k+1),(pm->psyns[0]),m+1);
memcpy((dfn+k+1),(pm->psyns[0]),m+1);
pm->defn = mystrdup(dfn);
} else {
pm->defn = mystrdup(pm->psyns[0]);
Expand Down

0 comments on commit c0b78f9

Please sign in to comment.