diff --git a/lib/client.c b/lib/client.c index 4a094a83..831f985e 100755 --- a/lib/client.c +++ b/lib/client.c @@ -562,13 +562,13 @@ lws_client_interpret_server_handshake(struct libwebsocket_context *context, 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++; }