Public feed
#378275
bool IODTPlatformExpert::getModelName( char * name, int maxLength )
{
OSData * prop;
const char * str;
int len;
char c;
bool ok = false;
maxLength--;
prop = (OSData *) getProvider()->getProperty( gIODTCompatibleKey );
if( prop ) {
str = (const char *) prop->getBytesNoCopy();
if( 0 == strncmp( str, "AAPL,", strlen( "AAPL," ) ))
str += strlen( "AAPL," );
len = 0;
while( (c = *str++)) {
if( (c == '/') || (c == ' '))
c = '-';
name[ len++ ] = c;
if( len >= maxLength)
break;
}
name[ len ] = 0;
ok = true;
}
return( ok );
}