Mail: Don't use strtok.
That seems like a bad idea...
This commit is contained in:
@@ -2952,14 +2952,14 @@ TMailWindow::OpenMessage(const entry_ref* ref, uint32 characterSetForDecoding)
|
|||||||
BMessage msg(REFS_RECEIVED);
|
BMessage msg(REFS_RECEIVED);
|
||||||
entry_ref enc_ref;
|
entry_ref enc_ref;
|
||||||
|
|
||||||
char* s = strtok((char*)string.String(), ":");
|
BStringList list;
|
||||||
while (s != NULL) {
|
string.Split(":", false, list);
|
||||||
BEntry entry(s, true);
|
for (int32 i = 0; i < list.CountStrings(); i++) {
|
||||||
|
BEntry entry(list.StringAt(i), true);
|
||||||
if (entry.Exists()) {
|
if (entry.Exists()) {
|
||||||
entry.GetRef(&enc_ref);
|
entry.GetRef(&enc_ref);
|
||||||
msg.AddRef("refs", &enc_ref);
|
msg.AddRef("refs", &enc_ref);
|
||||||
}
|
}
|
||||||
s = strtok(NULL, ":");
|
|
||||||
}
|
}
|
||||||
AddEnclosure(&msg);
|
AddEnclosure(&msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user