better parsetype routine

This commit is contained in:
Alexandre Ratchov 2011-11-11 10:41:18 +01:00
parent 96f647d64d
commit 1b0a15aba0
1 changed files with 4 additions and 7 deletions

View File

@ -44,16 +44,13 @@ sndio_debug_init(void)
const char *
sndio_parsetype(const char *str, char *type)
{
int c;
while ((c = *type++) != '\0') {
if (*str != c)
while (*type) {
if (*type != *str)
return NULL;
type++;
str++;
}
c = *str;
if (c != '/' && c != ',' && c != '@' && c != ':' && c != '\0')
if (*str >= 'a' && *str <= 'z')
return NULL;
return str;
}