From 1b0a15aba0aa30bcc4562d0c80eb004b18358537 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Fri, 11 Nov 2011 10:41:18 +0100 Subject: [PATCH] better parsetype routine --- libsndio/debug.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libsndio/debug.c b/libsndio/debug.c index 390dcbc..d03bfb7 100644 --- a/libsndio/debug.c +++ b/libsndio/debug.c @@ -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; } -