diff options
-rw-r--r-- | normalize.c | 8 |
1 files 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) { |