Skip to content

Commit

Permalink
check that driver names contain only [0-9a-z_] (nw)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuavas committed Sep 10, 2016
1 parent 6a2b41a commit b36662d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/emu/validity.cpp
Expand Up @@ -1378,6 +1378,14 @@ void validity_checker::validate_driver()
if (is_clone && strlen(m_current_driver->name) > 16)
osd_printf_error("Clone driver name must be 16 characters or less\n");

// make sure the driver name doesn't contain invalid characters
for (const char *s = m_current_driver->name; *s != 0; s++)
if (((*s < '0') || (*s > '9')) && ((*s < 'a') || (*s > 'z')) && (*s != '_'))
{
osd_printf_error("Driver name contains invalid characters\n");
break;
}

// make sure the year is only digits, '?' or '+'
for (const char *s = m_current_driver->year; *s != 0; s++)
if (!isdigit((UINT8)*s) && *s != '?' && *s != '+')
Expand Down

0 comments on commit b36662d

Please sign in to comment.