> However if we simply truncate to the correct length then the final LF > is replaced with NUL by snprintf. So we need to allocate room for one > extra char (the NUL) as you have done, but then not truncate the > write: so we both allocate and print with length > (this_message_size+1). Ah ah, got me nicely there :) Thanks