From 29536b4c4bd17a3c6ff325f3ba09812765b074bc Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 31 Aug 2019 23:01:51 -0400 Subject: [PATCH] Mail: Don't use strtok. That seems like a bad idea... --- src/apps/mail/MailWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp index 3a72957839..d3ea359a77 100644 --- a/src/apps/mail/MailWindow.cpp +++ b/src/apps/mail/MailWindow.cpp @@ -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); }