Joerg Lehmann - 2005-12-29

I think, I found a bug in the mailer.cpp.

Because after a vector::insert function the used iterator is potentially invalid, following lines are wrong:

mailer.cpp, line 160pp:

  message.insert(it, '\r');
  ++it;

mailer.cpp, line 175pp:

  message.insert(it + 1, '.');
  it += 2;

I think, a better way is following:

mailer.cpp, line 160pp:

  it = message.insert(it, '\r');
  ++it; // step to the '\n'
  if (it != message.end())
    ++it; // step past

mailer.cpp, line 175pp:

  it = message.insert(it + 1, '.');
  ++it; // step past

Greetings,
Joerg