From f024262b49b9e48a4fec759cfa2ebfc0247e3de2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 1 Jan 2024 19:11:22 +0200 Subject: [browser-cli] Fixed wrongly updating host and port --- browser-cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'browser-cli.c') diff --git a/browser-cli.c b/browser-cli.c index 64d5a73..d3d4c2f 100644 --- a/browser-cli.c +++ b/browser-cli.c @@ -151,13 +151,13 @@ int handleCLI(sds *host, sds *port, sds *uri, const sds page) { char* startPort = strchr(newURI, ':'); // Update host - if (startHost < startPath) { + if (startHost != NULL && startHost < startPath) { if (host != NULL) sdsfree(*host); *host = sdsnewlen(startHost + 1, hostLen(startHost + 1)); } // Update port - if (startPort < startPath) { + if (startPort != NULL && startPort < startPath) { if (port != NULL) sdsfree(*port); *port = sdsnewlen(startPort + 1, portLen(startPort + 1)); } -- cgit v1.2.3