lf_to_crlf(): NUL-terminate msg_data::data
commit32a8569ecf211cc2ba98333daa10b1a6e783ae87
authorMichael Haggerty <mhagger@alum.mit.edu>
Sun, 25 Nov 2012 11:08:36 +0000 (25 12:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Nov 2012 21:32:06 +0000 (26 13:32 -0800)
treeadd6d7d3764e9070fba74d079643e85228fc5f74
parent37141f27d8e0689fe465d8498656ee6543de3ea5
lf_to_crlf(): NUL-terminate msg_data::data

Through the rest of the file, the data member of struct msg_data is
kept NUL-terminated, and that fact is relied upon in a couple of
places.  Change lf_to_crlf() to preserve this invariant.

In fact, there are no execution paths in which lf_to_crlf() is called
and then its data member is required to be NUL-terminated, but it is
better to be consistent to prevent future confusion.

Document the invariant in the struct msg_data definition.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c