mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
strtok is not reentrant - it's not safe to call it any time you might be multi-threaded (nw)
This commit is contained in:
parent
7031c31c00
commit
05aac20ab6
@ -1855,21 +1855,22 @@ void output_images(std::ostream &out, device_t &device, const char *root_tag)
|
|||||||
|
|
||||||
if (loadable)
|
if (loadable)
|
||||||
{
|
{
|
||||||
const char *name = imagedev.instance_name().c_str();
|
char const *const name = imagedev.instance_name().c_str();
|
||||||
const char *shortname = imagedev.brief_instance_name().c_str();
|
char const *const shortname = imagedev.brief_instance_name().c_str();
|
||||||
|
|
||||||
out << "\t\t\t<instance";
|
out << "\t\t\t<instance";
|
||||||
out << util::string_format(" name=\"%s\"", normalize_string(name));
|
out << util::string_format(" name=\"%s\"", normalize_string(name));
|
||||||
out << util::string_format(" briefname=\"%s\"", normalize_string(shortname));
|
out << util::string_format(" briefname=\"%s\"", normalize_string(shortname));
|
||||||
out << "/>\n";
|
out << "/>\n";
|
||||||
|
|
||||||
std::string extensions(imagedev.file_extensions());
|
char const *extensions(imagedev.file_extensions());
|
||||||
|
while (extensions)
|
||||||
char *ext = strtok((char *)extensions.c_str(), ",");
|
|
||||||
while (ext != nullptr)
|
|
||||||
{
|
{
|
||||||
out << util::string_format("\t\t\t<extension name=\"%s\"/>\n", normalize_string(ext));
|
char const *end(extensions);
|
||||||
ext = strtok(nullptr, ",");
|
while (*end && (',' != *end))
|
||||||
|
++end;
|
||||||
|
out << util::string_format("\t\t\t<extension name=\"%s\"/>\n", normalize_string(std::string(extensions, end).c_str()));
|
||||||
|
extensions = *end ? (end + 1) : nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out << "\t\t</device>\n";
|
out << "\t\t</device>\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user