diff options
| author | Syndamia <kamen@syndamia.com> | 2024-01-01 19:11:22 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2024-01-01 19:11:22 +0200 |
| commit | f024262b49b9e48a4fec759cfa2ebfc0247e3de2 (patch) | |
| tree | a2d2d4d2326cc34babae11a5c694fa866663fecd | |
| parent | f3ab0863404a8eb723ad09756a5aa53d054a0160 (diff) | |
| download | pico-web-f024262b49b9e48a4fec759cfa2ebfc0247e3de2.tar pico-web-f024262b49b9e48a4fec759cfa2ebfc0247e3de2.tar.gz pico-web-f024262b49b9e48a4fec759cfa2ebfc0247e3de2.zip | |
[browser-cli] Fixed wrongly updating host and port
| -rw-r--r-- | browser-cli.c | 4 |
1 files changed, 2 insertions, 2 deletions
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)); } |
