Silences gcc 8.1.1's warning that the size of the source was being used,
not the destination. The destination has just been allocated to be the
size of the source so no overflow can occur. Move existing variable
that later holds the buffer size to before the allocation and strncpy so
it can be used for those too.
formatproc != NULL) {
filterbody(c1, buf, sizeof(buf), state, gstate);
} else {
- holder.c_text = mh_xmalloc (sizeof(buf));
- strncpy (holder.c_text, buf, sizeof(buf));
+ bufsz = sizeof buf;
+ holder.c_text = mh_xmalloc(bufsz);
+ strncpy(holder.c_text, buf, bufsz);
while (state == BODY) {
putcomp (c1, &holder, BODYCOMP);
bufsz = sizeof buf;