diff --git a/block/curl.c b/block/curl.c index 419df78258..684c677ef7 100644 --- a/block/curl.c +++ b/block/curl.c @@ -871,8 +871,8 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, goto out; } - if ((!strncasecmp(s->url, "http://", strlen("http://")) - || !strncasecmp(s->url, "https://", strlen("https://"))) + if ((!g_ascii_strncasecmp(s->url, "http://", strlen("http://")) + || !g_ascii_strncasecmp(s->url, "https://", strlen("https://"))) && !s->accept_range) { pstrcpy(state->errmsg, CURL_ERROR_SIZE, "Server does not support 'range' (byte ranges).");