client: fix verification of the accepted protocol
to properly take ", *" as delimiter
Signed-off-by: Alejandro Mery <amery@geeks.cl>
diff --git a/lib/client.c b/lib/client.c
index 4a094a8..831f985 100755
--- a/lib/client.c
+++ b/lib/client.c
@@ -562,13 +562,13 @@
while (pc && *pc && !okay) {
if (!strncmp(pc, p, len) &&
- (pc[len] == ',' || pc[len] == '\0')) {
+ (pc[len] == ',' || pc[len] == '\0')) {
okay = 1;
continue;
}
- while (*pc && *pc != ',')
- pc++;
- while (*pc && *pc != ' ')
+ while (*pc && *pc++ != ',')
+ ;
+ while (*pc && *pc == ' ')
pc++;
}