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 * const char *
sndio_parsetype(const char *str, char *type) sndio_parsetype(const char *str, char *type)
{ {
int c; while (*type) {
if (*type != *str)
while ((c = *type++) != '\0') {
if (*str != c)
return NULL; return NULL;
type++;
str++; str++;
} }
c = *str; if (*str >= 'a' && *str <= 'z')
if (c != '/' && c != ',' && c != '@' && c != ':' && c != '\0')
return NULL; return NULL;
return str; return str;
} }