diff --git a/lib/setopt.c b/lib/setopt.c index b8c639847a..b8fa1b89e6 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -174,7 +174,7 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val) *val |= h->protocol; } - } while(str++); + } while(str && str++); if(!*val) /* no protocol listed */