From 7ea4eb3fe07564f605731b4b4eef09a47c0bfb08 Mon Sep 17 00:00:00 2001 From: Ali Fardan Date: Sun, 22 Nov 2020 13:25:43 +0300 Subject: normalize: don't expect scheme to be present --- normalize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/normalize.c b/normalize.c index ec8fd9e..f8e8dbe 100644 --- a/normalize.c +++ b/normalize.c @@ -33,9 +33,11 @@ uri_normalize(struct uri *u) { int i; - for (i = 0; i < strlen(u->scheme); i++) { - if (isalpha(u->scheme[i])) - u->scheme[i] = tolower(u->scheme[i]); + if (u->scheme) { + for (i = 0; i < strlen(u->scheme); i++) { + if (isalpha(u->scheme[i])) + u->scheme[i] = tolower(u->scheme[i]); + } } if (u->authority.host) { -- cgit 1.4.1-2-gfad0