Commit a8cc71b9 authored by Pekka Pessi's avatar Pekka Pessi

Fixed hc_print usage in msg_header_prepare().

Some headers use snprintf() which may return -1 on some platforms if
buffer is too small.

darcs-hash:20060313162812-65a35-1e885f0dfb45ccb6b9fc7442ea9b0a7b15fc52ad.gz
parent 6036d3df
......@@ -1539,8 +1539,12 @@ int msg_header_prepare(msg_mclass_t const *mc, int flags,
if (!middle && hc->hc_name && hc->hc_name[0])
n += msg_header_name_e(b + n, bsiz >= n ? bsiz - n : 0, h, flags);
if ((m = hc->hc_print(b + n, bsiz >= n ? bsiz - n : 0, h, flags)) < 0)
return -1;
if ((m = hc->hc_print(b + n, bsiz >= n ? bsiz - n : 0, h, flags)) < 0) {
if (bsiz >= n + 64)
m = 2 * (bsiz - n);
else
m = 128;
}
n += m;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment