If a string to be placed in a memory file is longer than maxcols, the string transferred to the memory file is truncated at that length, and mf_rowrpl() returns a -1. If the string contains embedded newlines, all line segments in the string will be transferred before the return. Line segments of length greater than maxcols will be truncated.
If you are using strings with embedded newlines, no segment should exceed maxcols in length if you wish to avoid truncation.
If you are certain that the strings being handled do not contain embedded newlines, you can use the negative return value to branch to conditional code that will place the remainder of a truncated string in the memory file. This is shown in the second example below.