diff --git a/uri.c b/uri.c index 8f684ce1..88a0c2d1 100644 --- a/uri.c +++ b/uri.c @@ -72,8 +72,9 @@ coap_split_uri(unsigned char *str_var, size_t len, coap_uri_t *uri) { } /* There might be an additional 's', indicating the secure version: */ - if ( len && (secure = tolower(*p) == 's') ) - ++p; + if ( len && (secure = tolower(*p) == 's') ) { + ++p; --len; + } q = (unsigned char *)"://"; while (len && *q && tolower(*p) == *q) {