Mail: Don't use strtok.

That seems like a bad idea...
This commit is contained in:
Augustin Cavalier 2019-08-31 23:01:51 -04:00
parent 58a582ff22
commit 29536b4c4b

View File

@ -2952,14 +2952,14 @@ TMailWindow::OpenMessage(const entry_ref* ref, uint32 characterSetForDecoding)
BMessage msg(REFS_RECEIVED);
entry_ref enc_ref;
char* s = strtok((char*)string.String(), ":");
while (s != NULL) {
BEntry entry(s, true);
BStringList list;
string.Split(":", false, list);
for (int32 i = 0; i < list.CountStrings(); i++) {
BEntry entry(list.StringAt(i), true);
if (entry.Exists()) {
entry.GetRef(&enc_ref);
msg.AddRef("refs", &enc_ref);
}
s = strtok(NULL, ":");
}
AddEnclosure(&msg);
}